From 1b8b26a6aa384a41da0e198c1e9c7a121d276434 Mon Sep 17 00:00:00 2001 From: Omar Tawfik Date: Fri, 5 Feb 2016 03:35:50 -0800 Subject: [PATCH 01/13] Test fixes --- .../src/unittests/Tests.ProjectSystem.References.fs | 4 ++-- .../Project/ProjectSystem.Base.csproj | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/vsintegration/src/unittests/Tests.ProjectSystem.References.fs b/vsintegration/src/unittests/Tests.ProjectSystem.References.fs index 35c8b7d5ced..7fc4dd28e16 100644 --- a/vsintegration/src/unittests/Tests.ProjectSystem.References.fs +++ b/vsintegration/src/unittests/Tests.ProjectSystem.References.fs @@ -560,8 +560,8 @@ type References() = let dirName = Path.GetDirectoryName(projFile) let libDirName = Directory.CreateDirectory(Path.Combine(dirName, "lib")).FullName let codeBase = (new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase)).LocalPath |> Path.GetDirectoryName - let refLibPath = Path.Combine(libDirName, "nunit.core.dll") - File.Copy(Path.Combine(codeBase, "nunit.core.dll"), refLibPath) + let refLibPath = Path.Combine(libDirName, "nunit.framework.dll") + File.Copy(Path.Combine(codeBase, "nunit.framework.dll"), refLibPath) File.AppendAllText(projFile, TheTests.SimpleFsprojText([], [refLibPath], "")) use project = TheTests.CreateProject(projFile) let l = new List() diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ProjectSystem.Base.csproj b/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ProjectSystem.Base.csproj index 4863323b586..e1be43bbc9b 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ProjectSystem.Base.csproj @@ -119,7 +119,7 @@ - + @@ -179,7 +179,7 @@ - + {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF} FSharp.LanguageService.Base @@ -192,6 +192,10 @@ {DED3BBD7-53F4-428A-8C9F-27968E768605} FSharp.Core + + {ee85aab7-cda0-4c4e-bda0-a64ccc413e3f} + FSharp.LanguageService + \ No newline at end of file From 1915f82eb629e85acf7de42e8313ecd3a2554c7b Mon Sep 17 00:00:00 2001 From: Omar Tawfik Date: Sun, 7 Feb 2016 19:38:39 -0800 Subject: [PATCH 02/13] Update .net version to 4.6 --- src/FSharpSource.targets | 8 ++++---- tests/fsharp/core/interop/PCL.fsproj | 2 +- tests/fsharp/core/interop/User.fsproj | 2 +- .../netcore/ConsoleApplication1/portabletestentry.csproj | 2 +- .../netcoreautomationhelperlibrary.fsproj | 2 +- .../netcore/netcorelibrary1/netcoretestinglibrary.fsproj | 2 +- .../Events/TestTP/TypeProviderInCSharp.csproj | 2 +- .../Fields/Literals/TestTP/TypeProviderInCSharp.csproj | 2 +- .../Generics/TestTP/TypeProviderInCSharp.csproj | 2 +- .../Interfaces/Erased/TestTP/TypeProviderInCSharp.csproj | 2 +- .../Properties/Static/TestTP/TypeProviderInCSharp.csproj | 2 +- .../fsharpqa/testenv/src/ExecAssembly/ExecAssembly.fsproj | 2 +- .../FSharp.Compiler.Hosted/FSharp.Compiler.Hosted.fsproj | 2 +- .../src/HostedCompilerServer/HostedCompilerServer.fsproj | 2 +- tests/fsharpqa/testenv/src/ILComparer/ILComparer.fsproj | 2 +- tests/fsharpqa/testenv/src/diff/diff.fsproj | 2 +- .../ConsoleProjectTemplates.csproj | 2 +- .../src/Templates/ItemTemplates/ItemTemplates.csproj | 2 +- .../LibraryProjectTemplates.csproj | 2 +- .../NetCore259ProjectTemplates.csproj | 2 +- .../NETCorePortableLibrary/PortableLibrary.fsproj | 2 +- .../NetCore78ProjectTemplates.csproj | 2 +- .../NetCorePortableLibrary/PortableLibrary.fsproj | 2 +- .../NetCoreProjectTemplates.csproj | 2 +- .../NETCorePortableLibrary/PortableLibrary.fsproj | 2 +- .../PortableLibraryProjectTemplates.csproj | 2 +- .../Templates/ProjectTemplates/ProjectTemplates.csproj | 2 +- .../SilverlightProjectTemplates.csproj | 2 +- .../TutorialProjectTemplates.csproj | 2 +- .../deployment/EnableOpenSource/EnableOpenSource.csproj | 2 +- .../VWDExpressDeployTemplates.csproj | 2 +- .../VsProDeployTemplates/VsProDeployTemplates.csproj | 2 +- .../WDExpressDeployTemplates.csproj | 2 +- .../DefinitionLocationAttribute.csproj | 2 +- .../DefinitionLocationAttributeFileDoesnotExist.csproj | 2 +- .../DefinitionLocationAttributeLineDoesnotExist.csproj | 2 +- .../DefinitionLocationAttributeWithSpaceInTheType.csproj | 2 +- .../DummyProviderForLanguageServiceTesting.fsproj | 2 +- .../EditorHideMethodsAttribute.csproj | 2 +- .../EmptyAssembly/EmptyAssembly.fsproj | 2 +- .../XmlDocAttributeWithAdequateComment.csproj | 2 +- .../XmlDocAttributeWithEmptyComment.csproj | 2 +- .../XmlDocAttributeWithLocalizedComment.csproj | 2 +- .../XmlDocAttributeWithLongComment.csproj | 2 +- .../XmlDocAttributeWithNullComment.csproj | 2 +- .../src/unittests/Tests.ProjectSystem.UpToDate.fs | 4 ++-- .../FSharp.LanguageService.Base.csproj | 2 +- .../Project/ProjectSystem.Base.csproj | 2 +- .../VB/FSharpPropPage/FSharp.PropertiesPages.vbproj | 2 +- 49 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/FSharpSource.targets b/src/FSharpSource.targets index d987dd2cb21..9d8a3dc31ff 100644 --- a/src/FSharpSource.targets +++ b/src/FSharpSource.targets @@ -136,7 +136,7 @@ - v4.5 + v4.6 $(DefineConstants);FSHARP_CORE_4_5 $(DefineConstants);FX_ATLEAST_45 $(DefineConstants);FX_ATLEAST_40 @@ -239,7 +239,7 @@ $(DefineConstants);FX_EVENTWAITHANDLE_NO_IDISPOSABLE true Profile7 - v4.5 + v4.6 @@ -275,7 +275,7 @@ $(DefineConstants);FX_NO_CONCURRENT_DICTIONARY $(DefineConstants);FX_ATLEAST_LINQ Profile78 - v4.5 + v4.6 @@ -311,7 +311,7 @@ $(DefineConstants);FX_NO_CONCURRENT_DICTIONARY $(DefineConstants);FX_ATLEAST_LINQ Profile259 - v4.5 + v4.6 diff --git a/tests/fsharp/core/interop/PCL.fsproj b/tests/fsharp/core/interop/PCL.fsproj index 7e751cf636e..639650e3170 100644 --- a/tests/fsharp/core/interop/PCL.fsproj +++ b/tests/fsharp/core/interop/PCL.fsproj @@ -9,7 +9,7 @@ Library PCL PCL - v4.5 + v4.6 Profile78 netcore PCL diff --git a/tests/fsharp/core/interop/User.fsproj b/tests/fsharp/core/interop/User.fsproj index 4f4f465e000..02e9e439230 100644 --- a/tests/fsharp/core/interop/User.fsproj +++ b/tests/fsharp/core/interop/User.fsproj @@ -11,7 +11,7 @@ true User User - v4.5 + v4.6 User $(FSCBINPATH) diff --git a/tests/fsharp/core/netcore/ConsoleApplication1/portabletestentry.csproj b/tests/fsharp/core/netcore/ConsoleApplication1/portabletestentry.csproj index c2e452910c1..294f32596e0 100644 --- a/tests/fsharp/core/netcore/ConsoleApplication1/portabletestentry.csproj +++ b/tests/fsharp/core/netcore/ConsoleApplication1/portabletestentry.csproj @@ -9,7 +9,7 @@ Properties PortableTestEntry PortableTestEntry - v4.5 + v4.6 512 SAK SAK diff --git a/tests/fsharp/core/netcore/netcoreautomationhelperlibrary/netcoreautomationhelperlibrary.fsproj b/tests/fsharp/core/netcore/netcoreautomationhelperlibrary/netcoreautomationhelperlibrary.fsproj index 780ccf8bd50..aa2ef597392 100644 --- a/tests/fsharp/core/netcore/netcoreautomationhelperlibrary/netcoreautomationhelperlibrary.fsproj +++ b/tests/fsharp/core/netcore/netcoreautomationhelperlibrary/netcoreautomationhelperlibrary.fsproj @@ -9,7 +9,7 @@ Library NetCoreAutomationHelperLibrary NetCoreAutomationHelperLibrary - v4.5 + v4.6 netcore NetCoreAutomationHelperLibrary SAK diff --git a/tests/fsharp/core/netcore/netcorelibrary1/netcoretestinglibrary.fsproj b/tests/fsharp/core/netcore/netcorelibrary1/netcoretestinglibrary.fsproj index 27b39d2439f..d08ddbff1f0 100644 --- a/tests/fsharp/core/netcore/netcorelibrary1/netcoretestinglibrary.fsproj +++ b/tests/fsharp/core/netcore/netcorelibrary1/netcoretestinglibrary.fsproj @@ -9,7 +9,7 @@ Library NetCoreLibrary1 NetCoreTestingLibrary - v4.5 + v4.6 netcore NetCoreTestingLibrary SAK diff --git a/tests/fsharpqa/Source/TypeProviders/Events/TestTP/TypeProviderInCSharp.csproj b/tests/fsharpqa/Source/TypeProviders/Events/TestTP/TypeProviderInCSharp.csproj index a4870f2db1f..3ee208f06ec 100644 --- a/tests/fsharpqa/Source/TypeProviders/Events/TestTP/TypeProviderInCSharp.csproj +++ b/tests/fsharpqa/Source/TypeProviders/Events/TestTP/TypeProviderInCSharp.csproj @@ -43,7 +43,7 @@ Library {8226AB2A-FAC9-44CB-B9A5-4E543B0206F6} - v4.5 + v4.6 diff --git a/tests/fsharpqa/Source/TypeProviders/Fields/Literals/TestTP/TypeProviderInCSharp.csproj b/tests/fsharpqa/Source/TypeProviders/Fields/Literals/TestTP/TypeProviderInCSharp.csproj index a9f2c08a1e6..8e3ed9db1c8 100644 --- a/tests/fsharpqa/Source/TypeProviders/Fields/Literals/TestTP/TypeProviderInCSharp.csproj +++ b/tests/fsharpqa/Source/TypeProviders/Fields/Literals/TestTP/TypeProviderInCSharp.csproj @@ -9,7 +9,7 @@ Library TypeProviderInCSharp TypeProviderInCSharp - v4.5 + v4.6 512 diff --git a/tests/fsharpqa/Source/TypeProviders/Generics/TestTP/TypeProviderInCSharp.csproj b/tests/fsharpqa/Source/TypeProviders/Generics/TestTP/TypeProviderInCSharp.csproj index 9809c5e80a3..5d3c43ba2b7 100644 --- a/tests/fsharpqa/Source/TypeProviders/Generics/TestTP/TypeProviderInCSharp.csproj +++ b/tests/fsharpqa/Source/TypeProviders/Generics/TestTP/TypeProviderInCSharp.csproj @@ -10,7 +10,7 @@ Properties TypeProviderInCSharp TypeProviderInCSharp - v4.5 + v4.6 512 diff --git a/tests/fsharpqa/Source/TypeProviders/Interfaces/Erased/TestTP/TypeProviderInCSharp.csproj b/tests/fsharpqa/Source/TypeProviders/Interfaces/Erased/TestTP/TypeProviderInCSharp.csproj index 230e1144ef2..21932151cdb 100644 --- a/tests/fsharpqa/Source/TypeProviders/Interfaces/Erased/TestTP/TypeProviderInCSharp.csproj +++ b/tests/fsharpqa/Source/TypeProviders/Interfaces/Erased/TestTP/TypeProviderInCSharp.csproj @@ -10,7 +10,7 @@ Properties TypeProviderInCSharp TypeProviderInCSharp - v4.5 + v4.6 512 diff --git a/tests/fsharpqa/Source/TypeProviders/Properties/Static/TestTP/TypeProviderInCSharp.csproj b/tests/fsharpqa/Source/TypeProviders/Properties/Static/TestTP/TypeProviderInCSharp.csproj index 4ae2a7903c7..8993d41c963 100644 --- a/tests/fsharpqa/Source/TypeProviders/Properties/Static/TestTP/TypeProviderInCSharp.csproj +++ b/tests/fsharpqa/Source/TypeProviders/Properties/Static/TestTP/TypeProviderInCSharp.csproj @@ -10,7 +10,7 @@ Properties TypeProviderInCSharp TypeProviderInCSharp - v4.5 + v4.6 512 diff --git a/tests/fsharpqa/testenv/src/ExecAssembly/ExecAssembly.fsproj b/tests/fsharpqa/testenv/src/ExecAssembly/ExecAssembly.fsproj index c087f1d7d71..c0986c601cb 100644 --- a/tests/fsharpqa/testenv/src/ExecAssembly/ExecAssembly.fsproj +++ b/tests/fsharpqa/testenv/src/ExecAssembly/ExecAssembly.fsproj @@ -9,7 +9,7 @@ Exe FSharp.Test.ExecAssembly ExecAssembly - v4.5 + v4.6 true True ..\..\..\..\..\$(Configuration)\net40\bin diff --git a/tests/fsharpqa/testenv/src/FSharp.Compiler.Hosted/FSharp.Compiler.Hosted.fsproj b/tests/fsharpqa/testenv/src/FSharp.Compiler.Hosted/FSharp.Compiler.Hosted.fsproj index 2e22a5b0bd1..5d2f1fa0de6 100644 --- a/tests/fsharpqa/testenv/src/FSharp.Compiler.Hosted/FSharp.Compiler.Hosted.fsproj +++ b/tests/fsharpqa/testenv/src/FSharp.Compiler.Hosted/FSharp.Compiler.Hosted.fsproj @@ -9,7 +9,7 @@ Library FSharp.Compiler.Hosted FSharp.Compiler.Hosted - v4.5 + v4.6 true True ..\..\..\..\..\$(Configuration)\net40\bin diff --git a/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj b/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj index 2cb0144988d..29e1226f2c3 100644 --- a/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj +++ b/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj @@ -9,7 +9,7 @@ Exe HostedCompilerServer HostedCompilerServer - v4.5 + v4.6 true True ..\..\..\..\..\$(Configuration)\net40\bin diff --git a/tests/fsharpqa/testenv/src/ILComparer/ILComparer.fsproj b/tests/fsharpqa/testenv/src/ILComparer/ILComparer.fsproj index 99db1da8c19..56661b61d3f 100644 --- a/tests/fsharpqa/testenv/src/ILComparer/ILComparer.fsproj +++ b/tests/fsharpqa/testenv/src/ILComparer/ILComparer.fsproj @@ -9,7 +9,7 @@ Exe ILComparer ILComparer - v4.5 + v4.6 true True ..\..\..\..\..\$(Configuration)\net40\bin diff --git a/tests/fsharpqa/testenv/src/diff/diff.fsproj b/tests/fsharpqa/testenv/src/diff/diff.fsproj index cb79fba9f13..aaf5aee757b 100644 --- a/tests/fsharpqa/testenv/src/diff/diff.fsproj +++ b/tests/fsharpqa/testenv/src/diff/diff.fsproj @@ -9,7 +9,7 @@ Exe FSharp.Test.Diff diff - v4.5 + v4.6 true True ..\..\..\..\..\$(Configuration)\net40\bin diff --git a/vsintegration/src/Templates/ConsoleProjectTemplates/ConsoleProjectTemplates.csproj b/vsintegration/src/Templates/ConsoleProjectTemplates/ConsoleProjectTemplates.csproj index 796b14df66d..9c46296015d 100644 --- a/vsintegration/src/Templates/ConsoleProjectTemplates/ConsoleProjectTemplates.csproj +++ b/vsintegration/src/Templates/ConsoleProjectTemplates/ConsoleProjectTemplates.csproj @@ -40,7 +40,7 @@ Properties ConsoleProjectTemplates ConsoleProjectTemplates - v4.5 + v4.6 512 false false diff --git a/vsintegration/src/Templates/ItemTemplates/ItemTemplates.csproj b/vsintegration/src/Templates/ItemTemplates/ItemTemplates.csproj index db3e0219c32..e40ac14f45e 100644 --- a/vsintegration/src/Templates/ItemTemplates/ItemTemplates.csproj +++ b/vsintegration/src/Templates/ItemTemplates/ItemTemplates.csproj @@ -39,7 +39,7 @@ Properties ItemTemplates ItemTemplates - v4.5 + v4.6 512 false false diff --git a/vsintegration/src/Templates/LibraryProjectTemplates/LibraryProjectTemplates.csproj b/vsintegration/src/Templates/LibraryProjectTemplates/LibraryProjectTemplates.csproj index 3994d220623..da7848f4c06 100644 --- a/vsintegration/src/Templates/LibraryProjectTemplates/LibraryProjectTemplates.csproj +++ b/vsintegration/src/Templates/LibraryProjectTemplates/LibraryProjectTemplates.csproj @@ -40,7 +40,7 @@ Properties LibaryProjectTemplates LibaryProjectTemplates - v4.5 + v4.6 512 false false diff --git a/vsintegration/src/Templates/NetCore259ProjectTemplates/NetCore259ProjectTemplates.csproj b/vsintegration/src/Templates/NetCore259ProjectTemplates/NetCore259ProjectTemplates.csproj index f3ca6b3b147..89bd4e003d1 100644 --- a/vsintegration/src/Templates/NetCore259ProjectTemplates/NetCore259ProjectTemplates.csproj +++ b/vsintegration/src/Templates/NetCore259ProjectTemplates/NetCore259ProjectTemplates.csproj @@ -40,7 +40,7 @@ Properties NetCore259ProjectTemplates NetCore259ProjectTemplates - v4.5 + v4.6 512 false false diff --git a/vsintegration/src/Templates/NetCore259ProjectTemplates/ProjectTemplates/NETCorePortableLibrary/PortableLibrary.fsproj b/vsintegration/src/Templates/NetCore259ProjectTemplates/ProjectTemplates/NETCorePortableLibrary/PortableLibrary.fsproj index 4ccc9bf577b..7a45b6e6af3 100644 --- a/vsintegration/src/Templates/NetCore259ProjectTemplates/ProjectTemplates/NETCorePortableLibrary/PortableLibrary.fsproj +++ b/vsintegration/src/Templates/NetCore259ProjectTemplates/ProjectTemplates/NETCorePortableLibrary/PortableLibrary.fsproj @@ -9,7 +9,7 @@ Library $safeprojectname$ $safeprojectname$ - v4.5 + v4.6 Profile259 netcore 3.259.41.0 diff --git a/vsintegration/src/Templates/NetCore78ProjectTemplates/NetCore78ProjectTemplates.csproj b/vsintegration/src/Templates/NetCore78ProjectTemplates/NetCore78ProjectTemplates.csproj index db539aadee9..2e7db4adf18 100644 --- a/vsintegration/src/Templates/NetCore78ProjectTemplates/NetCore78ProjectTemplates.csproj +++ b/vsintegration/src/Templates/NetCore78ProjectTemplates/NetCore78ProjectTemplates.csproj @@ -40,7 +40,7 @@ Properties NetCoreProfile78ProjectTemplates NetCoreProfile78ProjectTemplates - v4.5 + v4.6 512 false false diff --git a/vsintegration/src/Templates/NetCore78ProjectTemplates/ProjectTemplates/NetCorePortableLibrary/PortableLibrary.fsproj b/vsintegration/src/Templates/NetCore78ProjectTemplates/ProjectTemplates/NetCorePortableLibrary/PortableLibrary.fsproj index 361488cb8ac..70e75fb9588 100644 --- a/vsintegration/src/Templates/NetCore78ProjectTemplates/ProjectTemplates/NetCorePortableLibrary/PortableLibrary.fsproj +++ b/vsintegration/src/Templates/NetCore78ProjectTemplates/ProjectTemplates/NetCorePortableLibrary/PortableLibrary.fsproj @@ -9,7 +9,7 @@ Library $safeprojectname$ $safeprojectname$ - v4.5 + v4.6 Profile78 netcore 3.78.41.0 diff --git a/vsintegration/src/Templates/NetCoreProjectTemplates/NetCoreProjectTemplates.csproj b/vsintegration/src/Templates/NetCoreProjectTemplates/NetCoreProjectTemplates.csproj index c5206993552..4dd9185545e 100644 --- a/vsintegration/src/Templates/NetCoreProjectTemplates/NetCoreProjectTemplates.csproj +++ b/vsintegration/src/Templates/NetCoreProjectTemplates/NetCoreProjectTemplates.csproj @@ -40,7 +40,7 @@ Properties NetCoreProjectTemplates NetCoreProjectTemplates - v4.5 + v4.6 512 false false diff --git a/vsintegration/src/Templates/NetCoreProjectTemplates/ProjectTemplates/NETCorePortableLibrary/PortableLibrary.fsproj b/vsintegration/src/Templates/NetCoreProjectTemplates/ProjectTemplates/NETCorePortableLibrary/PortableLibrary.fsproj index 960b3c056c9..1e0e8cf6a1f 100644 --- a/vsintegration/src/Templates/NetCoreProjectTemplates/ProjectTemplates/NETCorePortableLibrary/PortableLibrary.fsproj +++ b/vsintegration/src/Templates/NetCoreProjectTemplates/ProjectTemplates/NETCorePortableLibrary/PortableLibrary.fsproj @@ -9,7 +9,7 @@ Library $safeprojectname$ $safeprojectname$ - v4.5 + v4.6 Profile7 netcore 3.7.41.0 diff --git a/vsintegration/src/Templates/PortableLibraryProjectTemplates/PortableLibraryProjectTemplates.csproj b/vsintegration/src/Templates/PortableLibraryProjectTemplates/PortableLibraryProjectTemplates.csproj index dfa3698314f..a2f585c4662 100644 --- a/vsintegration/src/Templates/PortableLibraryProjectTemplates/PortableLibraryProjectTemplates.csproj +++ b/vsintegration/src/Templates/PortableLibraryProjectTemplates/PortableLibraryProjectTemplates.csproj @@ -40,7 +40,7 @@ Properties PortableLibraryProjectTemplates PortableLibraryProjectTemplates - v4.5 + v4.6 512 false false diff --git a/vsintegration/src/Templates/ProjectTemplates/ProjectTemplates.csproj b/vsintegration/src/Templates/ProjectTemplates/ProjectTemplates.csproj index d174191cac6..2faa466ffbd 100644 --- a/vsintegration/src/Templates/ProjectTemplates/ProjectTemplates.csproj +++ b/vsintegration/src/Templates/ProjectTemplates/ProjectTemplates.csproj @@ -38,7 +38,7 @@ Library ProjectTemplates ProjectTemplates - v4.5 + v4.6 512 false false diff --git a/vsintegration/src/Templates/SilverlightProjectTemplates/SilverlightProjectTemplates.csproj b/vsintegration/src/Templates/SilverlightProjectTemplates/SilverlightProjectTemplates.csproj index 35e817c6315..543dc4e2e69 100644 --- a/vsintegration/src/Templates/SilverlightProjectTemplates/SilverlightProjectTemplates.csproj +++ b/vsintegration/src/Templates/SilverlightProjectTemplates/SilverlightProjectTemplates.csproj @@ -40,7 +40,7 @@ Properties SilverlightProjectTemplates SilverlightProjectTemplates - v4.5 + v4.6 512 false false diff --git a/vsintegration/src/Templates/TutorialProjectTemplates/TutorialProjectTemplates.csproj b/vsintegration/src/Templates/TutorialProjectTemplates/TutorialProjectTemplates.csproj index 35047154c0b..1bbabb2e04e 100644 --- a/vsintegration/src/Templates/TutorialProjectTemplates/TutorialProjectTemplates.csproj +++ b/vsintegration/src/Templates/TutorialProjectTemplates/TutorialProjectTemplates.csproj @@ -40,7 +40,7 @@ Properties TutorialProjectTemplates TutorialProjectTemplates - v4.5 + v4.6 512 false false diff --git a/vsintegration/src/deployment/EnableOpenSource/EnableOpenSource.csproj b/vsintegration/src/deployment/EnableOpenSource/EnableOpenSource.csproj index ea49c6a12d0..0c0c7d9a454 100644 --- a/vsintegration/src/deployment/EnableOpenSource/EnableOpenSource.csproj +++ b/vsintegration/src/deployment/EnableOpenSource/EnableOpenSource.csproj @@ -36,7 +36,7 @@ Properties EnableOpenSource EnableOpenSource - v4.5 + v4.6 false false false diff --git a/vsintegration/src/deployment/VWDExpressDeployTemplates/VWDExpressDeployTemplates.csproj b/vsintegration/src/deployment/VWDExpressDeployTemplates/VWDExpressDeployTemplates.csproj index d3b7851ab21..61802ee336e 100644 --- a/vsintegration/src/deployment/VWDExpressDeployTemplates/VWDExpressDeployTemplates.csproj +++ b/vsintegration/src/deployment/VWDExpressDeployTemplates/VWDExpressDeployTemplates.csproj @@ -41,7 +41,7 @@ Properties VWDExpressDeployTemplates VWDExpressDeployTemplates - v4.5 + v4.6 false false false diff --git a/vsintegration/src/deployment/VsProDeployTemplates/VsProDeployTemplates.csproj b/vsintegration/src/deployment/VsProDeployTemplates/VsProDeployTemplates.csproj index 50d99ed83bc..48875d43314 100644 --- a/vsintegration/src/deployment/VsProDeployTemplates/VsProDeployTemplates.csproj +++ b/vsintegration/src/deployment/VsProDeployTemplates/VsProDeployTemplates.csproj @@ -21,7 +21,7 @@ Properties VsProDeployTemplates VsProDeployTemplates - v4.5 + v4.6 false false false diff --git a/vsintegration/src/deployment/WDExpressDeployTemplates/WDExpressDeployTemplates.csproj b/vsintegration/src/deployment/WDExpressDeployTemplates/WDExpressDeployTemplates.csproj index 3f43d6e5747..0f647545644 100644 --- a/vsintegration/src/deployment/WDExpressDeployTemplates/WDExpressDeployTemplates.csproj +++ b/vsintegration/src/deployment/WDExpressDeployTemplates/WDExpressDeployTemplates.csproj @@ -41,7 +41,7 @@ Properties WDExpressDeployTemplates WDExpressDeployTemplates - v4.5 + v4.6 false false false diff --git a/vsintegration/src/unittests/Resources.MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj b/vsintegration/src/unittests/Resources.MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj index 21ad57e35c7..89abd380a83 100644 --- a/vsintegration/src/unittests/Resources.MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj +++ b/vsintegration/src/unittests/Resources.MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj @@ -16,7 +16,7 @@ DEBUG;TRACE;$(DefineConstants) 4 0169;0067 - v4.5 + v4.6 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/src/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj b/vsintegration/src/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj index 5dec33158b7..c13779b38de 100644 --- a/vsintegration/src/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj +++ b/vsintegration/src/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj @@ -13,7 +13,7 @@ {8C2439BD-0E49-4929-A8B1-29CEE228191E} Library DefinitionLocationAttributeFileDoesnotExist - v4.5 + v4.6 DEBUG;TRACE;$(DefineConstants) 4 0169;0067 diff --git a/vsintegration/src/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj b/vsintegration/src/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj index d27b61528b8..3d8a0f7c5de 100644 --- a/vsintegration/src/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj +++ b/vsintegration/src/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj @@ -16,7 +16,7 @@ 4 0169;0067 DEBUG;TRACE;$(DefineConstants) - v4.5 + v4.6 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/src/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj b/vsintegration/src/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj index 446b4355d4c..22436a40362 100644 --- a/vsintegration/src/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj +++ b/vsintegration/src/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj @@ -16,7 +16,7 @@ 4 0169;0067 DEBUG;TRACE;$(DefineConstants) - v4.5 + v4.6 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/src/unittests/Resources.MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj b/vsintegration/src/unittests/Resources.MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj index fb538cd4119..a08b6a2152c 100644 --- a/vsintegration/src/unittests/Resources.MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj +++ b/vsintegration/src/unittests/Resources.MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj @@ -18,7 +18,7 @@ false False DEBUG;TRACE;$(DefineConstants) - v4.5 + v4.6 true $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/src/unittests/Resources.MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj b/vsintegration/src/unittests/Resources.MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj index 8a4a98499a6..8ce558af31f 100644 --- a/vsintegration/src/unittests/Resources.MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj +++ b/vsintegration/src/unittests/Resources.MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj @@ -16,7 +16,7 @@ 4 0169;0067 DEBUG;TRACE;$(DefineConstants) - v4.5 + v4.6 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/src/unittests/Resources.MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj b/vsintegration/src/unittests/Resources.MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj index 146a33ec40e..13f6e693aa2 100644 --- a/vsintegration/src/unittests/Resources.MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj +++ b/vsintegration/src/unittests/Resources.MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj @@ -18,7 +18,7 @@ 58;75 false DEBUG;TRACE;$(DefineConstants) - v4.5 + v4.6 true $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj b/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj index 22d5726da57..06007522c03 100644 --- a/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj +++ b/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj @@ -16,7 +16,7 @@ 4 0169;0067 DEBUG;TRACE;$(DefineConstants) - v4.5 + v4.6 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj b/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj index 70e0ba96b11..1fef6fd080e 100644 --- a/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj +++ b/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj @@ -16,7 +16,7 @@ 4 0169;0067 DEBUG;TRACE;$(DefineConstants) - v4.5 + v4.6 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj b/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj index 594a868ab49..e237a2c95a9 100644 --- a/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj +++ b/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj @@ -16,7 +16,7 @@ 4 0169;0067 DEBUG;TRACE;$(DefineConstants) - v4.5 + v4.6 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj b/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj index 3d166835dc6..df4b5baeb97 100644 --- a/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj +++ b/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj @@ -16,7 +16,7 @@ 4 0169;0067 DEBUG;TRACE;$(DefineConstants) - v4.5 + v4.6 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj b/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj index 05d039e94a1..6f83153c461 100644 --- a/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj +++ b/vsintegration/src/unittests/Resources.MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj @@ -16,7 +16,7 @@ 4 0169;0067 DEBUG;TRACE;$(DefineConstants) - v4.5 + v4.6 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/src/unittests/Tests.ProjectSystem.UpToDate.fs b/vsintegration/src/unittests/Tests.ProjectSystem.UpToDate.fs index 5e0550d26bd..e70539122ee 100644 --- a/vsintegration/src/unittests/Tests.ProjectSystem.UpToDate.fs +++ b/vsintegration/src/unittests/Tests.ProjectSystem.UpToDate.fs @@ -167,7 +167,7 @@ type UpToDate() = File.AppendAllText(proj1Path, TheTests.SimpleFsprojText( ["File1.fs"], // [], // - "v4.5")) // other stuff + "v4.6")) // other stuff use project1 = TheTests.CreateProject(proj1Path) let sourcePath1 = Path.Combine(project1.ProjectFolder, "File1.fs") File.AppendAllText(sourcePath1, "namespace Proj1\r\n") @@ -186,7 +186,7 @@ type UpToDate() = File.AppendAllText(proj2Path, TheTests.SimpleFsprojText( ["File2.fs"], // [output1], // - "v4.5")) // other stuff + "v4.6")) // other stuff use project2 = TheTests.CreateProject(proj2Path) let sourcePath2 = Path.Combine(project2.ProjectFolder, "File2.fs") File.AppendAllText(sourcePath2, "open Proj1\r\n") diff --git a/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj b/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj index c897c516d8b..e24900d1ce3 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj +++ b/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj @@ -18,7 +18,7 @@ true $(NoWarn);3001,3002,3003 $(DefineConstants);UITHREAD_FOR_LANGUAGESERVICE - v4.5 + v4.6 $(DefineConstants);FSHARP_CORE_4_5 $(DefineConstants);FX_ATLEAST_45 $(DefineConstants);FX_ATLEAST_40 diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ProjectSystem.Base.csproj b/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ProjectSystem.Base.csproj index e1be43bbc9b..39d45c8e43e 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ProjectSystem.Base.csproj @@ -17,7 +17,7 @@ {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7} $(DefineConstants);CODE_ANALYSIS;STAMP_OSS_VERSION true - v4.5 + v4.6 $(DefineConstants);FSHARP_CORE_4_5 $(DefineConstants);FX_ATLEAST_45 $(DefineConstants);FX_ATLEAST_40 diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Project/VB/FSharpPropPage/FSharp.PropertiesPages.vbproj b/vsintegration/src/vs/FsPkgs/FSharp.Project/VB/FSharpPropPage/FSharp.PropertiesPages.vbproj index 746b2b9d071..62acfc988f1 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.Project/VB/FSharpPropPage/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/vs/FsPkgs/FSharp.Project/VB/FSharpPropPage/FSharp.PropertiesPages.vbproj @@ -28,7 +28,7 @@ 40026;42105;42107;42353 true - v4.5 + v4.6 $(DefineConstants),FSHARP_CORE_4_5=True $(DefineConstants),FX_ATLEAST_45=True $(DefineConstants),FX_ATLEAST_40=True From d360287ae44cf9029f2bf50783add3827c02b3f7 Mon Sep 17 00:00:00 2001 From: Omar Tawfik Date: Tue, 9 Feb 2016 16:23:57 -0800 Subject: [PATCH 03/13] Added new language service/project/package based on Roslyn --- README.md | 1 + .../FSharp.Compiler/InternalsVisibleTo.fs | 1 + .../InternalsVisibleTo.fs | 1 + vsintegration/src/Salsa/salsa.fs | 1 + .../source.extension.vsixmanifest | 2 + .../FSharp.Editor/FSRoslynContentType.fs | 22 +++++ .../FSRoslynProjectSiteService.fs | 31 ++++++ .../FsPkgs/FSharp.Editor/FSharp.Editor.fsproj | 32 +++++- .../FSharp.Editor/extension.vsixmanifest | 43 ++++---- .../FSRoslynLanguageService.fs | 94 ++++++++++++++++++ .../FSharp.LanguageService/FSRoslynProject.fs | 98 +++++++++++++++++++ .../FSharp.LanguageService.fsproj | 20 ++++ .../FSharp.LanguageService/IProjectSite.fs | 3 + .../ProjectSitesAndFiles.fs | 2 + .../vs/FsPkgs/FSharp.Project/FS/Project.fs | 6 ++ .../DesignFramework/DesignerMessageBox.vb | 2 +- .../PropertyPages/BuildPropPage.vb | 2 +- 17 files changed, 336 insertions(+), 25 deletions(-) create mode 100644 vsintegration/src/vs/FsPkgs/FSharp.Editor/FSRoslynContentType.fs create mode 100644 vsintegration/src/vs/FsPkgs/FSharp.Editor/FSRoslynProjectSiteService.fs create mode 100644 vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSRoslynLanguageService.fs create mode 100644 vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSRoslynProject.fs diff --git a/README.md b/README.md index 0c41fb87e40..0f6c8fcc9cf 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ For F# 4.0 development - [.NET 3.5](http://www.microsoft.com/en-us/download/details.aspx?id=21) - [.NET 4.5](http://www.microsoft.com/en-us/download/details.aspx?id=30653) - [.NET 4.5.1](http://www.microsoft.com/en-us/download/details.aspx?id=40779) +- [.NET 4.6](https://www.microsoft.com/en-us/download/details.aspx?id=48137) - [MSBuild 12.0](http://www.microsoft.com/en-us/download/details.aspx?id=40760) - [Windows 7 SDK](http://www.microsoft.com/en-us/download/details.aspx?id=8279) - [Windows 8 SDK](http://msdn.microsoft.com/en-us/windows/desktop/hh852363.aspx) diff --git a/src/fsharp/FSharp.Compiler/InternalsVisibleTo.fs b/src/fsharp/FSharp.Compiler/InternalsVisibleTo.fs index b3a4f75fc52..bcf9fa96293 100644 --- a/src/fsharp/FSharp.Compiler/InternalsVisibleTo.fs +++ b/src/fsharp/FSharp.Compiler/InternalsVisibleTo.fs @@ -8,6 +8,7 @@ open System.Reflection [] [] [] +[] [] [] [] diff --git a/src/fsharp/FSharp.LanguageService.Compiler/InternalsVisibleTo.fs b/src/fsharp/FSharp.LanguageService.Compiler/InternalsVisibleTo.fs index 7ecc3a74ff8..f41722d1326 100644 --- a/src/fsharp/FSharp.LanguageService.Compiler/InternalsVisibleTo.fs +++ b/src/fsharp/FSharp.LanguageService.Compiler/InternalsVisibleTo.fs @@ -8,6 +8,7 @@ open System.Reflection [] [] [] +[] [] [] [] diff --git a/vsintegration/src/Salsa/salsa.fs b/vsintegration/src/Salsa/salsa.fs index 1a50ad15b4d..32923a5e777 100644 --- a/vsintegration/src/Salsa/salsa.fs +++ b/vsintegration/src/Salsa/salsa.fs @@ -312,6 +312,7 @@ module internal Salsa = member this.ErrorListTaskReporter() = None member this.AdviseProjectSiteChanges(callbackOwnerKey,callback) = changeHandlers.[callbackOwnerKey] <- callback member this.AdviseProjectSiteCleaned(callbackOwnerKey,callback) = () // no unit testing support here + member this.AdviseProjectSiteClosed(callbackOwnerKey,callback) = () // no unit testing support here member this.IsIncompleteTypeCheckEnvironment = false member this.TargetFrameworkMoniker = "" member this.LoadTime = System.DateTime(2000,1,1) diff --git a/vsintegration/src/deployment/EnableOpenSource/source.extension.vsixmanifest b/vsintegration/src/deployment/EnableOpenSource/source.extension.vsixmanifest index 217604fe881..7f550ceb259 100644 --- a/vsintegration/src/deployment/EnableOpenSource/source.extension.vsixmanifest +++ b/vsintegration/src/deployment/EnableOpenSource/source.extension.vsixmanifest @@ -29,5 +29,7 @@ + + \ No newline at end of file diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Editor/FSRoslynContentType.fs b/vsintegration/src/vs/FsPkgs/FSharp.Editor/FSRoslynContentType.fs new file mode 100644 index 00000000000..a94f9e0e020 --- /dev/null +++ b/vsintegration/src/vs/FsPkgs/FSharp.Editor/FSRoslynContentType.fs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.VisualStudio.FSharp.Editor + +open System.ComponentModel.Composition + +open Microsoft.CodeAnalysis.Editor +open Microsoft.VisualStudio.Utilities + +module FSRoslynStaticTypeDefinitions = + [] + [] + [] + let FSRoslynContentTypeDefinition = ContentTypeDefinition() + +[] +type FSRoslynContentTypeLanguageService [](contentTypeRegistry : IContentTypeRegistryService) = + member this.contentTypeRegistryService = contentTypeRegistry + + interface IContentTypeLanguageService with + member this.GetDefaultContentType() = + this.contentTypeRegistryService.GetContentType("F#"); diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Editor/FSRoslynProjectSiteService.fs b/vsintegration/src/vs/FsPkgs/FSharp.Editor/FSRoslynProjectSiteService.fs new file mode 100644 index 00000000000..285a808b9b3 --- /dev/null +++ b/vsintegration/src/vs/FsPkgs/FSharp.Editor/FSRoslynProjectSiteService.fs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.VisualStudio.FSharp.Editor + +open System.Composition + +open Microsoft.CodeAnalysis +open Microsoft.CodeAnalysis.Host +open Microsoft.CodeAnalysis.Host.Mef + +open Microsoft.VisualStudio.FSharp.LanguageService +open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem + +// Currently the CompilationOptions type in Roslyn in sealed and there's no way to set the compilation options for a project. +// There's no property bag on a project either. So this service is a means to get the host project for a given Roslyn project +// so that extra F# specific information can be stored on the host project. +// Note that the FSharpProject is available only through the VS Workspace although we might call this service from projects of +// some other workspace like the PreviewWorkspace. +type internal IHostProjectService = + inherit IWorkspaceService + + abstract member GetHostProject : id : ProjectId -> FSRoslynProject + +[, ServiceLayer.Default); Shared>] +type internal FSRoslynProjectSiteService [] (vsWorkspace : VisualStudioWorkspaceImpl) = + interface IWorkspaceServiceFactory with + member this.CreateService(_) = upcast this + + interface IHostProjectService with + member this.GetHostProject(id:ProjectId) = + downcast vsWorkspace.GetHostProject(id) diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/vs/FsPkgs/FSharp.Editor/FSharp.Editor.fsproj index 944afe5c02e..9cd3f9ca97f 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/vs/FsPkgs/FSharp.Editor/FSharp.Editor.fsproj @@ -23,10 +23,12 @@ - + false + + @@ -50,6 +52,7 @@ + @@ -64,6 +67,33 @@ + + ..\..\..\..\..\packages\Roslyn\System.Composition.AttributedModel.dll + + + ..\..\..\..\..\packages\Roslyn\System.Collections.Immutable.dll + + + ..\..\..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.dll + + + ..\..\..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.Workspaces.dll + + + ..\..\..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.Features.dll + + + ..\..\..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.EditorFeatures.dll + + + ..\..\..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.EditorFeatures.Text.dll + + + ..\..\..\..\..\packages\Roslyn\Microsoft.VisualStudio.LanguageServices.dll + + + ..\..\..\..\..\packages\Roslyn\Microsoft.VisualStudio.LanguageServices.Implementation.dll + \ No newline at end of file diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Editor/extension.vsixmanifest b/vsintegration/src/vs/FsPkgs/FSharp.Editor/extension.vsixmanifest index ec8e9ea37d5..2942212b682 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.Editor/extension.vsixmanifest +++ b/vsintegration/src/vs/FsPkgs/FSharp.Editor/extension.vsixmanifest @@ -1,24 +1,23 @@ - - - - Microsoft Visual FSharp Editor Extensions - Microsoft Corporation - 14.0 - Microsoft Visual FSharp Editor Extensions - 1033 - - - Pro - VWDExpress - WDExpress - - - + + + + + Microsoft Visual FSharp Editor Extensions + Microsoft Visual FSharp Editor Extensions + + + + + + true - - - - FSharp.Editor.dll - - \ No newline at end of file + + + + + + + + + \ No newline at end of file diff --git a/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSRoslynLanguageService.fs b/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSRoslynLanguageService.fs new file mode 100644 index 00000000000..551e06b0377 --- /dev/null +++ b/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSRoslynLanguageService.fs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.VisualStudio.FSharp.LanguageService + +open System +open System.Collections.Generic +open System.Runtime.InteropServices + +open Microsoft.FSharp.Compiler.SourceCodeServices + +open Microsoft.CodeAnalysis +open Microsoft.CodeAnalysis.SolutionCrawler +open Microsoft.VisualStudio +open Microsoft.VisualStudio.LanguageServices +open Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService +open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem +open Microsoft.VisualStudio.LanguageServices.Implementation +open Microsoft.VisualStudio.Shell +open Microsoft.VisualStudio.Shell.Interop + +module FSRoslynCommonConstants = + [] + let packageGuid = "871D2A70-12A2-4e42-9440-425DD92A4116" + [] + let languageServiceGuid = "BC6DD5A5-D4D6-4dab-A00D-A51242DBAF1B" + [] + let editorFactoryGuid = "4EB7CCB7-4336-4FFD-B12B-396E9FD079A9" + [] + let FSharpLanguageName = "F#" + [] + let FSharpContentType = "F#" + +[] +type FSRoslynLanguageService(package : FSRoslynPackage) = + inherit AbstractLanguageService(package) + + override this.ContentTypeName = FSRoslynCommonConstants.FSharpContentType + override this.LanguageName = FSRoslynCommonConstants.FSharpLanguageName + override this.RoslynLanguageName = FSRoslynCommonConstants.FSharpLanguageName + + override this.LanguageServiceId = new Guid(FSRoslynCommonConstants.languageServiceGuid) + override this.DebuggerLanguageId = DebuggerEnvironment.GetLanguageID() + + override this.CreateContext(_,_,_,_,_) = raise(System.NotImplementedException()) + + override this.SetupNewTextView(view) = + base.SetupNewTextView(view) + let workspace = this.Package.ComponentModel.GetService(); + let sp = new ServiceProvider(this.SystemServiceProvider.GetService()) + + // Ensure that we have a project in the workspace for this document. + let (_, buffer) = view.GetBuffer() + let filename = VsTextLines.GetFilename buffer + let result = VsRunningDocumentTable.FindDocumentWithoutLocking(sp.RunningDocumentTable,filename) + match result with + | Some (hier, _) -> + match hier with + | :? IProvideProjectSite as siteProvider -> + let site = siteProvider.GetProjectSite() + + let projectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(site.ProjectFileName(), site.ProjectFileName()) + if obj.ReferenceEquals(workspace.ProjectTracker.GetProject(projectId), null) then + let project = new FSRoslynProject(hier, this.SystemServiceProvider, workspace, site.ProjectFileName()); + project.Initialize(hier, site) + | _ -> () + | _ -> () + +and [] + FSharpEditorFactory(package : FSRoslynPackage) = + inherit AbstractEditorFactory(package) + + override this.ContentTypeName = FSRoslynCommonConstants.FSharpContentType + override this.GetFormattedTextChanges(_, _, _, _) = System.Collections.Generic.List() :> System.Collections.Generic.IList + +and [] + FSRoslynPackage() = + inherit AbstractPackage() + + override this.RoslynLanguageName = FSRoslynCommonConstants.FSharpLanguageName + + override this.Initialize() = + base.Initialize() + + override this.CreateWorkspace() = this.ComponentModel.GetService() + + override this.CreateLanguageService() = + let language = new FSRoslynLanguageService(this) + language + + override this.CreateEditorFactories() = + //let factory = FSharpEditorFactory(this) :> IVsEditorFactory + [] :> IEnumerable + + override this.RegisterMiscellaneousFilesWorkspaceInformation(_) = () diff --git a/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSRoslynProject.fs b/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSRoslynProject.fs new file mode 100644 index 00000000000..2e66afc4aae --- /dev/null +++ b/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSRoslynProject.fs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.VisualStudio.FSharp.LanguageService + +open Microsoft.VisualStudio +open Microsoft.VisualStudio.TextManager.Interop +open Microsoft.VisualStudio.Shell +open Microsoft.VisualStudio.Shell.Interop +open Microsoft.VisualStudio.FSharp.LanguageService +open Microsoft.FSharp.Compiler.SourceCodeServices +open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics +open Internal.Utilities.Collections +open Internal.Utilities.Debug +open System +open System.IO +open System.Diagnostics +open System.Collections.Generic +open Microsoft.CodeAnalysis +open Microsoft.VisualStudio.LanguageServices.Implementation +open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem + +type FSRoslynProject(hierarchy: IVsHierarchy, serviceProvider: System.IServiceProvider, visualStudioWorkspace: VisualStudioWorkspaceImpl, projectName: string) = + inherit AbstractProject(visualStudioWorkspace.ProjectTracker, null, projectName, hierarchy, "F#", serviceProvider, null, visualStudioWorkspace, null) + + let mutable checkOptions : FSharpProjectOptions option = None + + member internal this.CheckOptions = + match checkOptions with + | Some options -> options + | None -> failwith "Options haven't been computed yet." + + member internal this.Initialize(hier: IVsHierarchy, site : IProjectSite) = + this.ProjectTracker.AddProject(this) + + site.AdviseProjectSiteChanges(KnownAdviseProjectSiteChangesCallbackOwners.LanguageService, + new AdviseProjectSiteChanges(fun () -> this.OnProjectSettingsChanged(hier, site))) + + site.AdviseProjectSiteClosed(KnownAdviseProjectSiteChangesCallbackOwners.LanguageService, + new AdviseProjectSiteChanges(fun () -> this.Disconnect())) + + // Add files and references. + site.SourceFilesOnDisk() |> + Seq.iter(fun file -> this.AddDocument(hier, file)) + + this.GetReferences(site.CompilerFlags()) |> + Seq.iter(fun ref -> this.AddReference(ref) |> ignore) + + // Capture the F# specific options that we'll pass to the type checker. + checkOptions <- Some(ProjectSitesAndFiles.GetProjectOptionsForProjectSite(site, site.ProjectFileName())) + + member this.GetReferences(flags : string[]) = + let (|Reference|_|) (f : string) = if f.StartsWith("-r:") then Some (f.Replace("-r:", "")) else None + + let references = flags |> + Seq.map(fun flag -> match flag with + | Reference ref -> ref + | _ -> "") |> + Seq.where(fun s -> s <> "") + references + + member this.AddReference(filePath : string) = + this.AddMetadataReferenceAndTryConvertingToProjectReferenceIfPossible(filePath, new MetadataReferenceProperties(), VSConstants.S_FALSE) + + member this.RemoveReference(filePath: string) = + this.RemoveMetadataReference(filePath) + + member internal this.AddDocument(hier: IVsHierarchy, file : string) = + let itemid = + match hier.ParseCanonicalName(file) with + | (VSConstants.S_OK, id) -> id + | _ -> uint32 VSConstants.VSITEMID.Nil + + let document = this.ProjectTracker.DocumentProvider.TryGetDocumentForFile(this, itemid, file, SourceCodeKind.Regular, fun x -> true) + this.AddDocument(document, true) + + member internal this.OnProjectSettingsChanged(hier: IVsHierarchy, site : IProjectSite) = + let sourceFiles = site.SourceFilesOnDisk() + // Added files. + sourceFiles |> + Seq.where(fun file -> not(this.ContainsFile(file))) |> + Seq.iter(fun file -> this.AddDocument(hier, file)) + // Removed files. + this.GetCurrentDocuments() |> + Seq.where(fun doc -> not(sourceFiles |> Seq.contains(doc.FilePath))) |> + Seq.iter(fun doc -> this.RemoveDocument(doc)) + + let references = this.GetReferences(site.CompilerFlags()) + // Added references + references |> + Seq.where(fun ref -> not(this.HasMetadataReference(ref))) |> + Seq.iter(fun ref -> this.AddReference(ref) |> ignore) + // Removed references + this.GetCurrentMetadataReferences() |> + Seq.where(fun ref -> not(references |> Seq.contains(ref.FilePath))) |> + Seq.iter(fun ref -> this.RemoveReference(ref.FilePath)) + + // If the order of files changed, that'll be captured in the checkOptions. + checkOptions <- Some(ProjectSitesAndFiles.GetProjectOptionsForProjectSite(site, site.ProjectFileName())) diff --git a/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSharp.LanguageService.fsproj index 564eba79e36..c562bf07993 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -39,6 +39,8 @@ + + @@ -86,6 +88,24 @@ + + ..\..\..\..\..\packages\Roslyn\System.Collections.Immutable.dll + + + ..\..\..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.dll + + + ..\..\..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.Workspaces.dll + + + ..\..\..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.Features.dll + + + ..\..\..\..\..\packages\Roslyn\Microsoft.VisualStudio.LanguageServices.dll + + + ..\..\..\..\..\packages\Roslyn\Microsoft.VisualStudio.LanguageServices.Implementation.dll + {DED3BBD7-53F4-428A-8C9F-27968E768605} FSharp.Core diff --git a/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/IProjectSite.fs b/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/IProjectSite.fs index d7b6e498b83..e0aff674664 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/IProjectSite.fs +++ b/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/IProjectSite.fs @@ -21,6 +21,9 @@ type internal IProjectSite = /// Register for notifications when project is cleaned/rebuilt (and thus any live TypeProviders should be refreshed) abstract AdviseProjectSiteCleaned : (*callbackOwnerKey*)string * AdviseProjectSiteChanges -> unit + // Register for notifications when project is closed. + abstract AdviseProjectSiteClosed : (*callbackOwnerKey*)string * AdviseProjectSiteChanges -> unit + /// A user-friendly description of the project. Used only for developer/DEBUG tooltips and such. abstract DescriptionOfProject : unit -> string diff --git a/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/ProjectSitesAndFiles.fs b/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/ProjectSitesAndFiles.fs index 8441e4e57b5..18dbc0e6473 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/ProjectSitesAndFiles.fs +++ b/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/ProjectSitesAndFiles.fs @@ -32,6 +32,7 @@ type private ProjectSiteOfScriptFile(filename:string, checkOptions : FSharpProje override this.ErrorListTaskReporter() = None override this.AdviseProjectSiteChanges(_,_) = () override this.AdviseProjectSiteCleaned(_,_) = () + override this.AdviseProjectSiteClosed(_,_) = () override this.IsIncompleteTypeCheckEnvironment = checkOptions.IsIncompleteTypeCheckEnvironment override this.TargetFrameworkMoniker = "" override this.LoadTime = checkOptions.LoadTime @@ -62,6 +63,7 @@ type private ProjectSiteOfSingleFile(sourceFile) = override this.ErrorListTaskReporter() = None override this.AdviseProjectSiteChanges(_,_) = () override this.AdviseProjectSiteCleaned(_,_) = () + override this.AdviseProjectSiteClosed(_,_) = () override this.IsIncompleteTypeCheckEnvironment = true override this.TargetFrameworkMoniker = "" override this.LoadTime = new System.DateTime(2000,1,1) // any constant time is fine, orphan files do not interact with reloading based on update time diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Project/FS/Project.fs b/vsintegration/src/vs/FsPkgs/FSharp.Project/FS/Project.fs index 378d82dc50f..b403d93d457 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.Project/FS/Project.fs +++ b/vsintegration/src/vs/FsPkgs/FSharp.Project/FS/Project.fs @@ -105,6 +105,7 @@ namespace Microsoft.VisualStudio.FSharp.ProjectSystem member ips.ProjectFileName() = inner.ProjectFileName() member ips.AdviseProjectSiteChanges(callbackOwnerKey,callback) = inner.AdviseProjectSiteChanges(callbackOwnerKey, callback) member ips.AdviseProjectSiteCleaned(callbackOwnerKey,callback) = inner.AdviseProjectSiteCleaned(callbackOwnerKey, callback) + member ips.AdviseProjectSiteClosed(callbackOwnerKey,callback) = inner.AdviseProjectSiteClosed(callbackOwnerKey, callback) member ips.ErrorListTaskProvider() = inner.ErrorListTaskProvider() member ips.ErrorListTaskReporter() = inner.ErrorListTaskReporter() member ips.TargetFrameworkMoniker = inner.TargetFrameworkMoniker @@ -472,6 +473,7 @@ See also ...\SetupAuthoring\FSharp\Registry\FSProjSys_Registration.wxs, e.g. let sourcesAndFlagsNotifier = new Notifier() let cleanNotifier = new Notifier() + let closeNotifier = new Notifier() [] static val mutable private imageOffset : int @@ -648,6 +650,7 @@ See also ...\SetupAuthoring\FSharp\Registry\FSProjSys_Registration.wxs, e.g. | _ -> () vsProject <- null accessor <- null + closeNotifier.Notify() base.Close() override x.Load(filename:string, location:string, name:string, flags:uint32, iidProject:byref, canceled:byref ) = @@ -1611,6 +1614,8 @@ See also ...\SetupAuthoring\FSharp\Registry\FSProjSys_Registration.wxs, e.g. sourcesAndFlagsNotifier.Advise(callbackOwnerKey,callback) member this.AdviseProjectSiteCleaned(callbackOwnerKey,callback) = cleanNotifier.Advise(callbackOwnerKey,callback) + member this.AdviseProjectSiteClosed(callbackOwnerKey,callback) = + closeNotifier.Advise(callbackOwnerKey,callback) member this.IsIncompleteTypeCheckEnvironment = false member this.TargetFrameworkMoniker = x.GetTargetFrameworkMoniker() member this.LoadTime = creationTime @@ -1640,6 +1645,7 @@ See also ...\SetupAuthoring\FSharp\Registry\FSProjSys_Registration.wxs, e.g. member ips.ErrorListTaskReporter() = taskReporter member this.AdviseProjectSiteChanges(_,_) = () member this.AdviseProjectSiteCleaned(_,_) = () + member this.AdviseProjectSiteClosed(_,_) = () member this.IsIncompleteTypeCheckEnvironment = false member this.TargetFrameworkMoniker = targetFrameworkMoniker member this.LoadTime = creationTime diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Project/VB/FSharpPropPage/DesignFramework/DesignerMessageBox.vb b/vsintegration/src/vs/FsPkgs/FSharp.Project/VB/FSharpPropPage/DesignFramework/DesignerMessageBox.vb index a0e67740fbc..9465b046c15 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.Project/VB/FSharpPropPage/DesignFramework/DesignerMessageBox.vb +++ b/vsintegration/src/vs/FsPkgs/FSharp.Project/VB/FSharpPropPage/DesignFramework/DesignerMessageBox.vb @@ -76,7 +76,7 @@ Namespace Microsoft.VisualStudio.Editors.DesignerFramework End If 'Pull out the original exception from target invocation exceptions (happen during serialization, etc.) - If TypeOf ex Is Reflection.TargetInvocationException Then + If TypeOf ex Is System.Reflection.TargetInvocationException Then ex = ex.InnerException End If diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Project/VB/FSharpPropPage/PropertyPages/BuildPropPage.vb b/vsintegration/src/vs/FsPkgs/FSharp.Project/VB/FSharpPropPage/PropertyPages/BuildPropPage.vb index 51efaa35c58..160fefc8a6e 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.Project/VB/FSharpPropPage/PropertyPages/BuildPropPage.vb +++ b/vsintegration/src/vs/FsPkgs/FSharp.Project/VB/FSharpPropPage/PropertyPages/BuildPropPage.vb @@ -596,7 +596,7 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages Catch ex As InvalidCastException '// When all else fails assume dll (so they can edit it) OutputType = VSLangProj.prjOutputType.prjOutputTypeLibrary - Catch ex As Reflection.TargetInvocationException + Catch ex As System.Reflection.TargetInvocationException ' Property must be missing for this project flavor OutputType = VSLangProj.prjOutputType.prjOutputTypeLibrary End Try From 21571caa45edd5494455565022ca285a4cdd99c4 Mon Sep 17 00:00:00 2001 From: Omar Tawfik Date: Thu, 11 Feb 2016 17:13:21 -0800 Subject: [PATCH 04/13] Resolve conflicts due to projects refactoring --- .../FSharp.Editor/FSRoslynContentType.fs | 0 .../FSRoslynProjectSiteService.fs | 0 .../src/FSharp.Editor/FSharp.Editor.fsproj | 18 +++++++++--------- .../FSRoslynLanguageService.fs | 0 .../FSharp.LanguageService/FSRoslynProject.fs | 0 .../FSharp.LanguageService.fsproj | 12 ++++++------ .../Project/ProjectSystem.Base.csproj | 8 +++----- 7 files changed, 18 insertions(+), 20 deletions(-) rename vsintegration/src/{vs/FsPkgs => }/FSharp.Editor/FSRoslynContentType.fs (100%) rename vsintegration/src/{vs/FsPkgs => }/FSharp.Editor/FSRoslynProjectSiteService.fs (100%) rename vsintegration/src/{vs/FsPkgs => }/FSharp.LanguageService/FSRoslynLanguageService.fs (100%) rename vsintegration/src/{vs/FsPkgs => }/FSharp.LanguageService/FSRoslynProject.fs (100%) diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Editor/FSRoslynContentType.fs b/vsintegration/src/FSharp.Editor/FSRoslynContentType.fs similarity index 100% rename from vsintegration/src/vs/FsPkgs/FSharp.Editor/FSRoslynContentType.fs rename to vsintegration/src/FSharp.Editor/FSRoslynContentType.fs diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Editor/FSRoslynProjectSiteService.fs b/vsintegration/src/FSharp.Editor/FSRoslynProjectSiteService.fs similarity index 100% rename from vsintegration/src/vs/FsPkgs/FSharp.Editor/FSRoslynProjectSiteService.fs rename to vsintegration/src/FSharp.Editor/FSRoslynProjectSiteService.fs diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index a16160e190e..688065deed7 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -68,31 +68,31 @@ - ..\..\..\..\..\packages\Roslyn\System.Composition.AttributedModel.dll + ..\..\..\packages\Roslyn\System.Composition.AttributedModel.dll - ..\..\..\..\..\packages\Roslyn\System.Collections.Immutable.dll + ..\..\..\packages\Roslyn\System.Collections.Immutable.dll - ..\..\..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.dll + ..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.dll - ..\..\..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.Workspaces.dll + ..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.Workspaces.dll - ..\..\..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.Features.dll + ..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.Features.dll - ..\..\..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.EditorFeatures.dll + ..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.EditorFeatures.dll - ..\..\..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.EditorFeatures.Text.dll + ..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.EditorFeatures.Text.dll - ..\..\..\..\..\packages\Roslyn\Microsoft.VisualStudio.LanguageServices.dll + ..\..\..\packages\Roslyn\Microsoft.VisualStudio.LanguageServices.dll - ..\..\..\..\..\packages\Roslyn\Microsoft.VisualStudio.LanguageServices.Implementation.dll + ..\..\..\packages\Roslyn\Microsoft.VisualStudio.LanguageServices.Implementation.dll diff --git a/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSRoslynLanguageService.fs b/vsintegration/src/FSharp.LanguageService/FSRoslynLanguageService.fs similarity index 100% rename from vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSRoslynLanguageService.fs rename to vsintegration/src/FSharp.LanguageService/FSRoslynLanguageService.fs diff --git a/vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSRoslynProject.fs b/vsintegration/src/FSharp.LanguageService/FSRoslynProject.fs similarity index 100% rename from vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSRoslynProject.fs rename to vsintegration/src/FSharp.LanguageService/FSRoslynProject.fs diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index 93e7de282b6..37ad0bfdad4 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -89,22 +89,22 @@ - ..\..\..\..\..\packages\Roslyn\System.Collections.Immutable.dll + ..\..\..\packages\Roslyn\System.Collections.Immutable.dll - ..\..\..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.dll + ..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.dll - ..\..\..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.Workspaces.dll + ..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.Workspaces.dll - ..\..\..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.Features.dll + ..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.Features.dll - ..\..\..\..\..\packages\Roslyn\Microsoft.VisualStudio.LanguageServices.dll + ..\..\..\packages\Roslyn\Microsoft.VisualStudio.LanguageServices.dll - ..\..\..\..\..\packages\Roslyn\Microsoft.VisualStudio.LanguageServices.Implementation.dll + ..\..\..\packages\Roslyn\Microsoft.VisualStudio.LanguageServices.Implementation.dll {DED3BBD7-53F4-428A-8C9F-27968E768605} diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj index 2a2076838eb..3e43b652632 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj @@ -26,7 +26,8 @@ $(DefineConstants);QUERIES_IN_FSLIB $(DefineConstants);PUT_TYPE_PROVIDERS_IN_FSCORE; $(DefineConstants);FX_ATLEAST_LINQ - + + @@ -88,7 +89,6 @@ - @@ -101,7 +101,6 @@ - @@ -179,7 +178,6 @@ - {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF} FSharp.LanguageService.Base @@ -193,7 +191,7 @@ {DED3BBD7-53F4-428A-8C9F-27968E768605} FSharp.Core - + {ee85aab7-cda0-4c4e-bda0-a64ccc413e3f} FSharp.LanguageService From 497c854cc294495276774b3ad1560b2967020eac Mon Sep 17 00:00:00 2001 From: Omar Tawfik Date: Fri, 12 Feb 2016 04:38:33 -0800 Subject: [PATCH 05/13] Added switch between old/new language services --- .../src/FSharp.Editor/FSRoslynContentType.fs | 6 ++- .../src/FSharp.Editor/FSharp.Editor.fsproj | 2 +- .../FSRoslynLanguageService.fs | 15 +------ .../FSharp.LanguageService.fsproj | 1 + .../FSharpLanguageService.fs | 2 - .../FSharp.LanguageService/FSharpPackage.fs | 11 +---- .../LanguageServiceUtils.fs | 42 +++++++++++++++++++ 7 files changed, 51 insertions(+), 28 deletions(-) create mode 100644 vsintegration/src/FSharp.LanguageService/LanguageServiceUtils.fs diff --git a/vsintegration/src/FSharp.Editor/FSRoslynContentType.fs b/vsintegration/src/FSharp.Editor/FSRoslynContentType.fs index a94f9e0e020..467e0973340 100644 --- a/vsintegration/src/FSharp.Editor/FSRoslynContentType.fs +++ b/vsintegration/src/FSharp.Editor/FSRoslynContentType.fs @@ -7,16 +7,18 @@ open System.ComponentModel.Composition open Microsoft.CodeAnalysis.Editor open Microsoft.VisualStudio.Utilities +open Microsoft.VisualStudio.FSharp.LanguageService + module FSRoslynStaticTypeDefinitions = [] [] [] let FSRoslynContentTypeDefinition = ContentTypeDefinition() -[] +[] type FSRoslynContentTypeLanguageService [](contentTypeRegistry : IContentTypeRegistryService) = member this.contentTypeRegistryService = contentTypeRegistry interface IContentTypeLanguageService with member this.GetDefaultContentType() = - this.contentTypeRegistryService.GetContentType("F#"); + this.contentTypeRegistryService.GetContentType(FSRoslynCommonConstants.FSharpContentType); diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 688065deed7..d284a122e71 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -23,11 +23,11 @@ - false + diff --git a/vsintegration/src/FSharp.LanguageService/FSRoslynLanguageService.fs b/vsintegration/src/FSharp.LanguageService/FSRoslynLanguageService.fs index 551e06b0377..a1c8946cbfa 100644 --- a/vsintegration/src/FSharp.LanguageService/FSRoslynLanguageService.fs +++ b/vsintegration/src/FSharp.LanguageService/FSRoslynLanguageService.fs @@ -18,18 +18,6 @@ open Microsoft.VisualStudio.LanguageServices.Implementation open Microsoft.VisualStudio.Shell open Microsoft.VisualStudio.Shell.Interop -module FSRoslynCommonConstants = - [] - let packageGuid = "871D2A70-12A2-4e42-9440-425DD92A4116" - [] - let languageServiceGuid = "BC6DD5A5-D4D6-4dab-A00D-A51242DBAF1B" - [] - let editorFactoryGuid = "4EB7CCB7-4336-4FFD-B12B-396E9FD079A9" - [] - let FSharpLanguageName = "F#" - [] - let FSharpContentType = "F#" - [] type FSRoslynLanguageService(package : FSRoslynPackage) = inherit AbstractLanguageService(package) @@ -79,7 +67,8 @@ and [] override this.RoslynLanguageName = FSRoslynCommonConstants.FSharpLanguageName override this.Initialize() = - base.Initialize() + if LanguageServiceUtils.shouldEnableRoslynLanguageService then + base.Initialize() override this.CreateWorkspace() = this.ComponentModel.GetService() diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index 37ad0bfdad4..a1889f029e0 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -25,6 +25,7 @@ + diff --git a/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs b/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs index 54b2110fbd5..9e5444cd9a9 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs +++ b/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs @@ -44,8 +44,6 @@ module internal FSharpConstants = let PLKProductName = "f#" // "Visual Studio Integration of FSharp Language Service" let PLKProductVersion = "1.0" let PLKResourceID = 1s - let enableLanguageService = "fsharp-language-service-enabled" - /// This class defines capabilities of the language service. diff --git a/vsintegration/src/FSharp.LanguageService/FSharpPackage.fs b/vsintegration/src/FSharp.LanguageService/FSharpPackage.fs index fb61e0e854a..d5c5cca3566 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharpPackage.fs +++ b/vsintegration/src/FSharp.LanguageService/FSharpPackage.fs @@ -19,20 +19,11 @@ type internal SVsSettingsPersistenceManager = class end [] type internal FSharpPackage() as self = inherit Package() - - // In case the config file is incorrect, we silently recover and leave the feature enabled - let enableLanguageService = - try - "false" <> ConfigurationManager.AppSettings.[FSharpConstants.enableLanguageService] - with e -> - System.Diagnostics.Debug.Assert - (false, sprintf "Error while loading 'devenv.exe.config' configuration: %A" e) - true let mutable componentID = 0u let CreateIfEnabled container serviceType = - if enableLanguageService then + if LanguageServiceUtils.shouldEnableVSLanguageService then self.CreateService(container,serviceType) else null diff --git a/vsintegration/src/FSharp.LanguageService/LanguageServiceUtils.fs b/vsintegration/src/FSharp.LanguageService/LanguageServiceUtils.fs new file mode 100644 index 00000000000..c5cfd34e74a --- /dev/null +++ b/vsintegration/src/FSharp.LanguageService/LanguageServiceUtils.fs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.VisualStudio.FSharp.LanguageService + +open System +open System.Configuration +open System.Diagnostics + +module FSRoslynCommonConstants = + [] + let packageGuid = "871D2A70-12A2-4e42-9440-425DD92A4116" + [] + let languageServiceGuid = "BC6DD5A5-D4D6-4dab-A00D-A51242DBAF1B" + [] + let editorFactoryGuid = "4EB7CCB7-4336-4FFD-B12B-396E9FD079A9" + [] + let FSharpLanguageName = "F#" + [] + let FSharpContentType = "F#" + +module LanguageServiceUtils = + + // This key can have 'off', 'vs', and 'roslyn' states. Will default to 'vs'. + let private languageServiceTypeKey = "fsharp-language-service" + + let private getConfigValue(key: string) = + try + ConfigurationManager.AppSettings.[key].ToLower() + with ex -> + Debug.Assert(false, sprintf "Error loading 'devenv.exe.config' configuration[%s]: %A" key ex) + String.Empty + + let shouldEnableVSLanguageService = + match getConfigValue(languageServiceTypeKey) with + | "off" -> false + | "roslyn" -> false + | _ -> true + + let shouldEnableRoslynLanguageService = + match getConfigValue(languageServiceTypeKey) with + | "roslyn" -> true + | _ -> false From dbd4a83656d3d82b6ae09c14da5cdf26222f4dc7 Mon Sep 17 00:00:00 2001 From: Omar Tawfik Date: Tue, 16 Feb 2016 11:22:36 -0800 Subject: [PATCH 06/13] Added Roslyn myget packages to build --- .nuget/NuGet.Config | 1 + packages.config | 8 ++++++++ src/FSharpSource.targets | 3 +++ .../src/FSharp.Editor/FSharp.Editor.fsproj | 19 ++++++++----------- .../FSharp.LanguageService.fsproj | 13 +++++-------- 5 files changed, 25 insertions(+), 19 deletions(-) diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config index baef485daec..f2dee4af8f9 100644 --- a/.nuget/NuGet.Config +++ b/.nuget/NuGet.Config @@ -7,6 +7,7 @@ + \ No newline at end of file diff --git a/packages.config b/packages.config index f311d7fb273..a80d26b9ace 100644 --- a/packages.config +++ b/packages.config @@ -4,4 +4,12 @@ + + + + + + + + \ No newline at end of file diff --git a/src/FSharpSource.targets b/src/FSharpSource.targets index 9d8a3dc31ff..0fc94fd5f68 100644 --- a/src/FSharpSource.targets +++ b/src/FSharpSource.targets @@ -112,6 +112,9 @@ 2.0.3 2.0.3.0 $(FSharpSourcesRoot)\..\packages\FsCheck.$(FsCheckVersion)\lib\ + 1.0.30 + 1.1.37 + 1.2.0-beta1-20160215-01 diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index d284a122e71..7ad31fc245e 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -68,31 +68,28 @@ - ..\..\..\packages\Roslyn\System.Composition.AttributedModel.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.Composition.$(MicrosoftCompositionVersion)\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll - ..\..\..\packages\Roslyn\System.Collections.Immutable.dll + $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\dotnet\System.Collections.Immutable.dll - ..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Common.$(RoslynVersion)\lib\net45\Microsoft.CodeAnalysis.dll - ..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.Workspaces.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.$(RoslynVersion)\lib\net45\Microsoft.CodeAnalysis.Workspaces.dll - ..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.Features.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Features.$(RoslynVersion)\lib\net45\Microsoft.CodeAnalysis.Features.dll - ..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.EditorFeatures.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.EditorFeatures.$(RoslynVersion)\lib\net46\Microsoft.CodeAnalysis.EditorFeatures.dll - ..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.EditorFeatures.Text.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.EditorFeatures.Text.$(RoslynVersion)\lib\net46\Microsoft.CodeAnalysis.EditorFeatures.Text.dll - ..\..\..\packages\Roslyn\Microsoft.VisualStudio.LanguageServices.dll - - - ..\..\..\packages\Roslyn\Microsoft.VisualStudio.LanguageServices.Implementation.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.LanguageServices.$(RoslynVersion)\lib\net46\Microsoft.VisualStudio.LanguageServices.dll diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index a1889f029e0..2b1c58eb72e 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -90,22 +90,19 @@ - ..\..\..\packages\Roslyn\System.Collections.Immutable.dll + $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\dotnet\System.Collections.Immutable.dll - ..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Common.$(RoslynVersion)\lib\net45\Microsoft.CodeAnalysis.dll - ..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.Workspaces.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.$(RoslynVersion)\lib\net45\Microsoft.CodeAnalysis.Workspaces.dll - ..\..\..\packages\Roslyn\Microsoft.CodeAnalysis.Features.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Features.$(RoslynVersion)\lib\net45\Microsoft.CodeAnalysis.Features.dll - ..\..\..\packages\Roslyn\Microsoft.VisualStudio.LanguageServices.dll - - - ..\..\..\packages\Roslyn\Microsoft.VisualStudio.LanguageServices.Implementation.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.LanguageServices.$(RoslynVersion)\lib\net46\Microsoft.VisualStudio.LanguageServices.dll {DED3BBD7-53F4-428A-8C9F-27968E768605} From 90462270f16ac5af8ce7b7293d9040667094614f Mon Sep 17 00:00:00 2001 From: Omar Tawfik Date: Tue, 16 Feb 2016 12:15:51 -0800 Subject: [PATCH 07/13] Revert "Update .net version to 4.6" This reverts commit 1915f82eb629e85acf7de42e8313ecd3a2554c7b. --- src/FSharpSource.targets | 8 ++++---- tests/fsharp/core/interop/PCL.fsproj | 2 +- tests/fsharp/core/interop/User.fsproj | 2 +- .../netcore/ConsoleApplication1/portabletestentry.csproj | 2 +- .../netcoreautomationhelperlibrary.fsproj | 2 +- .../netcore/netcorelibrary1/netcoretestinglibrary.fsproj | 2 +- .../Events/TestTP/TypeProviderInCSharp.csproj | 2 +- .../Fields/Literals/TestTP/TypeProviderInCSharp.csproj | 2 +- .../Generics/TestTP/TypeProviderInCSharp.csproj | 2 +- .../Interfaces/Erased/TestTP/TypeProviderInCSharp.csproj | 2 +- .../Properties/Static/TestTP/TypeProviderInCSharp.csproj | 2 +- .../fsharpqa/testenv/src/ExecAssembly/ExecAssembly.fsproj | 2 +- .../FSharp.Compiler.Hosted/FSharp.Compiler.Hosted.fsproj | 2 +- .../src/HostedCompilerServer/HostedCompilerServer.fsproj | 2 +- tests/fsharpqa/testenv/src/ILComparer/ILComparer.fsproj | 2 +- tests/fsharpqa/testenv/src/diff/diff.fsproj | 2 +- .../deployment/EnableOpenSource/EnableOpenSource.csproj | 2 +- .../VWDExpressDeployTemplates.csproj | 2 +- .../VsProDeployTemplates/VsProDeployTemplates.csproj | 2 +- .../WDExpressDeployTemplates.csproj | 2 +- .../FSharp.LanguageService.Base.csproj | 2 +- .../Project/ProjectSystem.Base.csproj | 2 +- .../FSharp.PropertiesPages.vbproj | 2 +- .../ConsoleProjectTemplates.csproj | 2 +- .../src/Templates/ItemTemplates/ItemTemplates.csproj | 2 +- .../LibraryProjectTemplates.csproj | 2 +- .../NetCore259ProjectTemplates.csproj | 2 +- .../NETCorePortableLibrary/PortableLibrary.fsproj | 2 +- .../NetCore78ProjectTemplates.csproj | 2 +- .../NetCorePortableLibrary/PortableLibrary.fsproj | 2 +- .../NetCoreProjectTemplates.csproj | 2 +- .../NETCorePortableLibrary/PortableLibrary.fsproj | 2 +- .../PortableLibraryProjectTemplates.csproj | 2 +- .../Templates/ProjectTemplates/ProjectTemplates.csproj | 2 +- .../SilverlightProjectTemplates.csproj | 2 +- .../TutorialProjectTemplates.csproj | 2 +- .../DefinitionLocationAttribute.csproj | 2 +- .../DefinitionLocationAttributeFileDoesnotExist.csproj | 2 +- .../DefinitionLocationAttributeLineDoesnotExist.csproj | 2 +- .../DefinitionLocationAttributeWithSpaceInTheType.csproj | 2 +- .../DummyProviderForLanguageServiceTesting.fsproj | 2 +- .../EditorHideMethodsAttribute.csproj | 2 +- .../EmptyAssembly/EmptyAssembly.fsproj | 2 +- .../XmlDocAttributeWithAdequateComment.csproj | 2 +- .../XmlDocAttributeWithEmptyComment.csproj | 2 +- .../XmlDocAttributeWithLocalizedComment.csproj | 2 +- .../XmlDocAttributeWithLongComment.csproj | 2 +- .../XmlDocAttributeWithNullComment.csproj | 2 +- .../tests/unittests/Tests.ProjectSystem.UpToDate.fs | 4 ++-- 49 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/FSharpSource.targets b/src/FSharpSource.targets index 0fc94fd5f68..7467e638432 100644 --- a/src/FSharpSource.targets +++ b/src/FSharpSource.targets @@ -139,7 +139,7 @@ - v4.6 + v4.5 $(DefineConstants);FSHARP_CORE_4_5 $(DefineConstants);FX_ATLEAST_45 $(DefineConstants);FX_ATLEAST_40 @@ -242,7 +242,7 @@ $(DefineConstants);FX_EVENTWAITHANDLE_NO_IDISPOSABLE true Profile7 - v4.6 + v4.5 @@ -278,7 +278,7 @@ $(DefineConstants);FX_NO_CONCURRENT_DICTIONARY $(DefineConstants);FX_ATLEAST_LINQ Profile78 - v4.6 + v4.5 @@ -314,7 +314,7 @@ $(DefineConstants);FX_NO_CONCURRENT_DICTIONARY $(DefineConstants);FX_ATLEAST_LINQ Profile259 - v4.6 + v4.5 diff --git a/tests/fsharp/core/interop/PCL.fsproj b/tests/fsharp/core/interop/PCL.fsproj index 639650e3170..7e751cf636e 100644 --- a/tests/fsharp/core/interop/PCL.fsproj +++ b/tests/fsharp/core/interop/PCL.fsproj @@ -9,7 +9,7 @@ Library PCL PCL - v4.6 + v4.5 Profile78 netcore PCL diff --git a/tests/fsharp/core/interop/User.fsproj b/tests/fsharp/core/interop/User.fsproj index 02e9e439230..4f4f465e000 100644 --- a/tests/fsharp/core/interop/User.fsproj +++ b/tests/fsharp/core/interop/User.fsproj @@ -11,7 +11,7 @@ true User User - v4.6 + v4.5 User $(FSCBINPATH) diff --git a/tests/fsharp/core/netcore/ConsoleApplication1/portabletestentry.csproj b/tests/fsharp/core/netcore/ConsoleApplication1/portabletestentry.csproj index 294f32596e0..c2e452910c1 100644 --- a/tests/fsharp/core/netcore/ConsoleApplication1/portabletestentry.csproj +++ b/tests/fsharp/core/netcore/ConsoleApplication1/portabletestentry.csproj @@ -9,7 +9,7 @@ Properties PortableTestEntry PortableTestEntry - v4.6 + v4.5 512 SAK SAK diff --git a/tests/fsharp/core/netcore/netcoreautomationhelperlibrary/netcoreautomationhelperlibrary.fsproj b/tests/fsharp/core/netcore/netcoreautomationhelperlibrary/netcoreautomationhelperlibrary.fsproj index aa2ef597392..780ccf8bd50 100644 --- a/tests/fsharp/core/netcore/netcoreautomationhelperlibrary/netcoreautomationhelperlibrary.fsproj +++ b/tests/fsharp/core/netcore/netcoreautomationhelperlibrary/netcoreautomationhelperlibrary.fsproj @@ -9,7 +9,7 @@ Library NetCoreAutomationHelperLibrary NetCoreAutomationHelperLibrary - v4.6 + v4.5 netcore NetCoreAutomationHelperLibrary SAK diff --git a/tests/fsharp/core/netcore/netcorelibrary1/netcoretestinglibrary.fsproj b/tests/fsharp/core/netcore/netcorelibrary1/netcoretestinglibrary.fsproj index d08ddbff1f0..27b39d2439f 100644 --- a/tests/fsharp/core/netcore/netcorelibrary1/netcoretestinglibrary.fsproj +++ b/tests/fsharp/core/netcore/netcorelibrary1/netcoretestinglibrary.fsproj @@ -9,7 +9,7 @@ Library NetCoreLibrary1 NetCoreTestingLibrary - v4.6 + v4.5 netcore NetCoreTestingLibrary SAK diff --git a/tests/fsharpqa/Source/TypeProviders/Events/TestTP/TypeProviderInCSharp.csproj b/tests/fsharpqa/Source/TypeProviders/Events/TestTP/TypeProviderInCSharp.csproj index 3ee208f06ec..a4870f2db1f 100644 --- a/tests/fsharpqa/Source/TypeProviders/Events/TestTP/TypeProviderInCSharp.csproj +++ b/tests/fsharpqa/Source/TypeProviders/Events/TestTP/TypeProviderInCSharp.csproj @@ -43,7 +43,7 @@ Library {8226AB2A-FAC9-44CB-B9A5-4E543B0206F6} - v4.6 + v4.5 diff --git a/tests/fsharpqa/Source/TypeProviders/Fields/Literals/TestTP/TypeProviderInCSharp.csproj b/tests/fsharpqa/Source/TypeProviders/Fields/Literals/TestTP/TypeProviderInCSharp.csproj index 8e3ed9db1c8..a9f2c08a1e6 100644 --- a/tests/fsharpqa/Source/TypeProviders/Fields/Literals/TestTP/TypeProviderInCSharp.csproj +++ b/tests/fsharpqa/Source/TypeProviders/Fields/Literals/TestTP/TypeProviderInCSharp.csproj @@ -9,7 +9,7 @@ Library TypeProviderInCSharp TypeProviderInCSharp - v4.6 + v4.5 512 diff --git a/tests/fsharpqa/Source/TypeProviders/Generics/TestTP/TypeProviderInCSharp.csproj b/tests/fsharpqa/Source/TypeProviders/Generics/TestTP/TypeProviderInCSharp.csproj index 5d3c43ba2b7..9809c5e80a3 100644 --- a/tests/fsharpqa/Source/TypeProviders/Generics/TestTP/TypeProviderInCSharp.csproj +++ b/tests/fsharpqa/Source/TypeProviders/Generics/TestTP/TypeProviderInCSharp.csproj @@ -10,7 +10,7 @@ Properties TypeProviderInCSharp TypeProviderInCSharp - v4.6 + v4.5 512 diff --git a/tests/fsharpqa/Source/TypeProviders/Interfaces/Erased/TestTP/TypeProviderInCSharp.csproj b/tests/fsharpqa/Source/TypeProviders/Interfaces/Erased/TestTP/TypeProviderInCSharp.csproj index 21932151cdb..230e1144ef2 100644 --- a/tests/fsharpqa/Source/TypeProviders/Interfaces/Erased/TestTP/TypeProviderInCSharp.csproj +++ b/tests/fsharpqa/Source/TypeProviders/Interfaces/Erased/TestTP/TypeProviderInCSharp.csproj @@ -10,7 +10,7 @@ Properties TypeProviderInCSharp TypeProviderInCSharp - v4.6 + v4.5 512 diff --git a/tests/fsharpqa/Source/TypeProviders/Properties/Static/TestTP/TypeProviderInCSharp.csproj b/tests/fsharpqa/Source/TypeProviders/Properties/Static/TestTP/TypeProviderInCSharp.csproj index 8993d41c963..4ae2a7903c7 100644 --- a/tests/fsharpqa/Source/TypeProviders/Properties/Static/TestTP/TypeProviderInCSharp.csproj +++ b/tests/fsharpqa/Source/TypeProviders/Properties/Static/TestTP/TypeProviderInCSharp.csproj @@ -10,7 +10,7 @@ Properties TypeProviderInCSharp TypeProviderInCSharp - v4.6 + v4.5 512 diff --git a/tests/fsharpqa/testenv/src/ExecAssembly/ExecAssembly.fsproj b/tests/fsharpqa/testenv/src/ExecAssembly/ExecAssembly.fsproj index c0986c601cb..c087f1d7d71 100644 --- a/tests/fsharpqa/testenv/src/ExecAssembly/ExecAssembly.fsproj +++ b/tests/fsharpqa/testenv/src/ExecAssembly/ExecAssembly.fsproj @@ -9,7 +9,7 @@ Exe FSharp.Test.ExecAssembly ExecAssembly - v4.6 + v4.5 true True ..\..\..\..\..\$(Configuration)\net40\bin diff --git a/tests/fsharpqa/testenv/src/FSharp.Compiler.Hosted/FSharp.Compiler.Hosted.fsproj b/tests/fsharpqa/testenv/src/FSharp.Compiler.Hosted/FSharp.Compiler.Hosted.fsproj index 5d2f1fa0de6..2e22a5b0bd1 100644 --- a/tests/fsharpqa/testenv/src/FSharp.Compiler.Hosted/FSharp.Compiler.Hosted.fsproj +++ b/tests/fsharpqa/testenv/src/FSharp.Compiler.Hosted/FSharp.Compiler.Hosted.fsproj @@ -9,7 +9,7 @@ Library FSharp.Compiler.Hosted FSharp.Compiler.Hosted - v4.6 + v4.5 true True ..\..\..\..\..\$(Configuration)\net40\bin diff --git a/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj b/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj index 29e1226f2c3..2cb0144988d 100644 --- a/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj +++ b/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj @@ -9,7 +9,7 @@ Exe HostedCompilerServer HostedCompilerServer - v4.6 + v4.5 true True ..\..\..\..\..\$(Configuration)\net40\bin diff --git a/tests/fsharpqa/testenv/src/ILComparer/ILComparer.fsproj b/tests/fsharpqa/testenv/src/ILComparer/ILComparer.fsproj index 56661b61d3f..99db1da8c19 100644 --- a/tests/fsharpqa/testenv/src/ILComparer/ILComparer.fsproj +++ b/tests/fsharpqa/testenv/src/ILComparer/ILComparer.fsproj @@ -9,7 +9,7 @@ Exe ILComparer ILComparer - v4.6 + v4.5 true True ..\..\..\..\..\$(Configuration)\net40\bin diff --git a/tests/fsharpqa/testenv/src/diff/diff.fsproj b/tests/fsharpqa/testenv/src/diff/diff.fsproj index aaf5aee757b..cb79fba9f13 100644 --- a/tests/fsharpqa/testenv/src/diff/diff.fsproj +++ b/tests/fsharpqa/testenv/src/diff/diff.fsproj @@ -9,7 +9,7 @@ Exe FSharp.Test.Diff diff - v4.6 + v4.5 true True ..\..\..\..\..\$(Configuration)\net40\bin diff --git a/vsintegration/deployment/EnableOpenSource/EnableOpenSource.csproj b/vsintegration/deployment/EnableOpenSource/EnableOpenSource.csproj index 5249cdb7525..ac7cee170a2 100644 --- a/vsintegration/deployment/EnableOpenSource/EnableOpenSource.csproj +++ b/vsintegration/deployment/EnableOpenSource/EnableOpenSource.csproj @@ -37,7 +37,7 @@ Properties EnableOpenSource EnableOpenSource - v4.6 + v4.5 false false false diff --git a/vsintegration/deployment/VWDExpressDeployTemplates/VWDExpressDeployTemplates.csproj b/vsintegration/deployment/VWDExpressDeployTemplates/VWDExpressDeployTemplates.csproj index 0b2af1596a0..8b0b7b68e8c 100644 --- a/vsintegration/deployment/VWDExpressDeployTemplates/VWDExpressDeployTemplates.csproj +++ b/vsintegration/deployment/VWDExpressDeployTemplates/VWDExpressDeployTemplates.csproj @@ -41,7 +41,7 @@ Properties VWDExpressDeployTemplates VWDExpressDeployTemplates - v4.6 + v4.5 false false false diff --git a/vsintegration/deployment/VsProDeployTemplates/VsProDeployTemplates.csproj b/vsintegration/deployment/VsProDeployTemplates/VsProDeployTemplates.csproj index 2019504eb8b..c82a9c88c50 100644 --- a/vsintegration/deployment/VsProDeployTemplates/VsProDeployTemplates.csproj +++ b/vsintegration/deployment/VsProDeployTemplates/VsProDeployTemplates.csproj @@ -21,7 +21,7 @@ Properties VsProDeployTemplates VsProDeployTemplates - v4.6 + v4.5 false false false diff --git a/vsintegration/deployment/WDExpressDeployTemplates/WDExpressDeployTemplates.csproj b/vsintegration/deployment/WDExpressDeployTemplates/WDExpressDeployTemplates.csproj index 950bf1093f3..92e66536cda 100644 --- a/vsintegration/deployment/WDExpressDeployTemplates/WDExpressDeployTemplates.csproj +++ b/vsintegration/deployment/WDExpressDeployTemplates/WDExpressDeployTemplates.csproj @@ -41,7 +41,7 @@ Properties WDExpressDeployTemplates WDExpressDeployTemplates - v4.6 + v4.5 false false false diff --git a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj index 522b7e595e5..aa6d4500afa 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj +++ b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj @@ -18,7 +18,7 @@ true $(NoWarn);3001,3002,3003 $(DefineConstants);UITHREAD_FOR_LANGUAGESERVICE - v4.6 + v4.5 $(DefineConstants);FSHARP_CORE_4_5 $(DefineConstants);FX_ATLEAST_45 $(DefineConstants);FX_ATLEAST_40 diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj index 3e43b652632..edb57d4ff23 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj @@ -17,7 +17,7 @@ {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7} $(DefineConstants);CODE_ANALYSIS;STAMP_OSS_VERSION true - v4.6 + v4.5 $(DefineConstants);FSHARP_CORE_4_5 $(DefineConstants);FX_ATLEAST_45 $(DefineConstants);FX_ATLEAST_40 diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj index e5f3d3f5254..c691d52d833 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj @@ -28,7 +28,7 @@ 40026;42105;42107;42353 true - v4.6 + v4.5 $(DefineConstants),FSHARP_CORE_4_5=True $(DefineConstants),FX_ATLEAST_45=True $(DefineConstants),FX_ATLEAST_40=True diff --git a/vsintegration/src/Templates/ConsoleProjectTemplates/ConsoleProjectTemplates.csproj b/vsintegration/src/Templates/ConsoleProjectTemplates/ConsoleProjectTemplates.csproj index 6b40f1cf9ab..f5dec77e189 100644 --- a/vsintegration/src/Templates/ConsoleProjectTemplates/ConsoleProjectTemplates.csproj +++ b/vsintegration/src/Templates/ConsoleProjectTemplates/ConsoleProjectTemplates.csproj @@ -40,7 +40,7 @@ Properties ConsoleProjectTemplates ConsoleProjectTemplates - v4.6 + v4.5 512 false false diff --git a/vsintegration/src/Templates/ItemTemplates/ItemTemplates.csproj b/vsintegration/src/Templates/ItemTemplates/ItemTemplates.csproj index 93227ed764a..80e54763ce8 100644 --- a/vsintegration/src/Templates/ItemTemplates/ItemTemplates.csproj +++ b/vsintegration/src/Templates/ItemTemplates/ItemTemplates.csproj @@ -39,7 +39,7 @@ Properties ItemTemplates ItemTemplates - v4.6 + v4.5 512 false false diff --git a/vsintegration/src/Templates/LibraryProjectTemplates/LibraryProjectTemplates.csproj b/vsintegration/src/Templates/LibraryProjectTemplates/LibraryProjectTemplates.csproj index fd501cd36ea..f7a8fb10410 100644 --- a/vsintegration/src/Templates/LibraryProjectTemplates/LibraryProjectTemplates.csproj +++ b/vsintegration/src/Templates/LibraryProjectTemplates/LibraryProjectTemplates.csproj @@ -40,7 +40,7 @@ Properties LibaryProjectTemplates LibaryProjectTemplates - v4.6 + v4.5 512 false false diff --git a/vsintegration/src/Templates/NetCore259ProjectTemplates/NetCore259ProjectTemplates.csproj b/vsintegration/src/Templates/NetCore259ProjectTemplates/NetCore259ProjectTemplates.csproj index d26faa60f22..f6806c59cc9 100644 --- a/vsintegration/src/Templates/NetCore259ProjectTemplates/NetCore259ProjectTemplates.csproj +++ b/vsintegration/src/Templates/NetCore259ProjectTemplates/NetCore259ProjectTemplates.csproj @@ -40,7 +40,7 @@ Properties NetCore259ProjectTemplates NetCore259ProjectTemplates - v4.6 + v4.5 512 false false diff --git a/vsintegration/src/Templates/NetCore259ProjectTemplates/ProjectTemplates/NETCorePortableLibrary/PortableLibrary.fsproj b/vsintegration/src/Templates/NetCore259ProjectTemplates/ProjectTemplates/NETCorePortableLibrary/PortableLibrary.fsproj index 7a45b6e6af3..4ccc9bf577b 100644 --- a/vsintegration/src/Templates/NetCore259ProjectTemplates/ProjectTemplates/NETCorePortableLibrary/PortableLibrary.fsproj +++ b/vsintegration/src/Templates/NetCore259ProjectTemplates/ProjectTemplates/NETCorePortableLibrary/PortableLibrary.fsproj @@ -9,7 +9,7 @@ Library $safeprojectname$ $safeprojectname$ - v4.6 + v4.5 Profile259 netcore 3.259.41.0 diff --git a/vsintegration/src/Templates/NetCore78ProjectTemplates/NetCore78ProjectTemplates.csproj b/vsintegration/src/Templates/NetCore78ProjectTemplates/NetCore78ProjectTemplates.csproj index cea69bbf516..4cdb58b305f 100644 --- a/vsintegration/src/Templates/NetCore78ProjectTemplates/NetCore78ProjectTemplates.csproj +++ b/vsintegration/src/Templates/NetCore78ProjectTemplates/NetCore78ProjectTemplates.csproj @@ -40,7 +40,7 @@ Properties NetCoreProfile78ProjectTemplates NetCoreProfile78ProjectTemplates - v4.6 + v4.5 512 false false diff --git a/vsintegration/src/Templates/NetCore78ProjectTemplates/ProjectTemplates/NetCorePortableLibrary/PortableLibrary.fsproj b/vsintegration/src/Templates/NetCore78ProjectTemplates/ProjectTemplates/NetCorePortableLibrary/PortableLibrary.fsproj index 70e75fb9588..361488cb8ac 100644 --- a/vsintegration/src/Templates/NetCore78ProjectTemplates/ProjectTemplates/NetCorePortableLibrary/PortableLibrary.fsproj +++ b/vsintegration/src/Templates/NetCore78ProjectTemplates/ProjectTemplates/NetCorePortableLibrary/PortableLibrary.fsproj @@ -9,7 +9,7 @@ Library $safeprojectname$ $safeprojectname$ - v4.6 + v4.5 Profile78 netcore 3.78.41.0 diff --git a/vsintegration/src/Templates/NetCoreProjectTemplates/NetCoreProjectTemplates.csproj b/vsintegration/src/Templates/NetCoreProjectTemplates/NetCoreProjectTemplates.csproj index 8d3260bffcb..19e4d12fa15 100644 --- a/vsintegration/src/Templates/NetCoreProjectTemplates/NetCoreProjectTemplates.csproj +++ b/vsintegration/src/Templates/NetCoreProjectTemplates/NetCoreProjectTemplates.csproj @@ -40,7 +40,7 @@ Properties NetCoreProjectTemplates NetCoreProjectTemplates - v4.6 + v4.5 512 false false diff --git a/vsintegration/src/Templates/NetCoreProjectTemplates/ProjectTemplates/NETCorePortableLibrary/PortableLibrary.fsproj b/vsintegration/src/Templates/NetCoreProjectTemplates/ProjectTemplates/NETCorePortableLibrary/PortableLibrary.fsproj index 1e0e8cf6a1f..960b3c056c9 100644 --- a/vsintegration/src/Templates/NetCoreProjectTemplates/ProjectTemplates/NETCorePortableLibrary/PortableLibrary.fsproj +++ b/vsintegration/src/Templates/NetCoreProjectTemplates/ProjectTemplates/NETCorePortableLibrary/PortableLibrary.fsproj @@ -9,7 +9,7 @@ Library $safeprojectname$ $safeprojectname$ - v4.6 + v4.5 Profile7 netcore 3.7.41.0 diff --git a/vsintegration/src/Templates/PortableLibraryProjectTemplates/PortableLibraryProjectTemplates.csproj b/vsintegration/src/Templates/PortableLibraryProjectTemplates/PortableLibraryProjectTemplates.csproj index 4e66db8d6bd..ece82ca6549 100644 --- a/vsintegration/src/Templates/PortableLibraryProjectTemplates/PortableLibraryProjectTemplates.csproj +++ b/vsintegration/src/Templates/PortableLibraryProjectTemplates/PortableLibraryProjectTemplates.csproj @@ -40,7 +40,7 @@ Properties PortableLibraryProjectTemplates PortableLibraryProjectTemplates - v4.6 + v4.5 512 false false diff --git a/vsintegration/src/Templates/ProjectTemplates/ProjectTemplates.csproj b/vsintegration/src/Templates/ProjectTemplates/ProjectTemplates.csproj index 2faa466ffbd..d174191cac6 100644 --- a/vsintegration/src/Templates/ProjectTemplates/ProjectTemplates.csproj +++ b/vsintegration/src/Templates/ProjectTemplates/ProjectTemplates.csproj @@ -38,7 +38,7 @@ Library ProjectTemplates ProjectTemplates - v4.6 + v4.5 512 false false diff --git a/vsintegration/src/Templates/SilverlightProjectTemplates/SilverlightProjectTemplates.csproj b/vsintegration/src/Templates/SilverlightProjectTemplates/SilverlightProjectTemplates.csproj index f6b898de11d..71123e66db4 100644 --- a/vsintegration/src/Templates/SilverlightProjectTemplates/SilverlightProjectTemplates.csproj +++ b/vsintegration/src/Templates/SilverlightProjectTemplates/SilverlightProjectTemplates.csproj @@ -40,7 +40,7 @@ Properties SilverlightProjectTemplates SilverlightProjectTemplates - v4.6 + v4.5 512 false false diff --git a/vsintegration/src/Templates/TutorialProjectTemplates/TutorialProjectTemplates.csproj b/vsintegration/src/Templates/TutorialProjectTemplates/TutorialProjectTemplates.csproj index 9cbbf8a0ab3..5eed0d06971 100644 --- a/vsintegration/src/Templates/TutorialProjectTemplates/TutorialProjectTemplates.csproj +++ b/vsintegration/src/Templates/TutorialProjectTemplates/TutorialProjectTemplates.csproj @@ -40,7 +40,7 @@ Properties TutorialProjectTemplates TutorialProjectTemplates - v4.6 + v4.5 512 false false diff --git a/vsintegration/tests/unittests/Resources.MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj b/vsintegration/tests/unittests/Resources.MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj index 89abd380a83..21ad57e35c7 100644 --- a/vsintegration/tests/unittests/Resources.MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj +++ b/vsintegration/tests/unittests/Resources.MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj @@ -16,7 +16,7 @@ DEBUG;TRACE;$(DefineConstants) 4 0169;0067 - v4.6 + v4.5 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/tests/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj b/vsintegration/tests/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj index c13779b38de..5dec33158b7 100644 --- a/vsintegration/tests/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj +++ b/vsintegration/tests/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj @@ -13,7 +13,7 @@ {8C2439BD-0E49-4929-A8B1-29CEE228191E} Library DefinitionLocationAttributeFileDoesnotExist - v4.6 + v4.5 DEBUG;TRACE;$(DefineConstants) 4 0169;0067 diff --git a/vsintegration/tests/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj b/vsintegration/tests/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj index 3d8a0f7c5de..d27b61528b8 100644 --- a/vsintegration/tests/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj +++ b/vsintegration/tests/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj @@ -16,7 +16,7 @@ 4 0169;0067 DEBUG;TRACE;$(DefineConstants) - v4.6 + v4.5 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/tests/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj b/vsintegration/tests/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj index 22436a40362..446b4355d4c 100644 --- a/vsintegration/tests/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj +++ b/vsintegration/tests/unittests/Resources.MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj @@ -16,7 +16,7 @@ 4 0169;0067 DEBUG;TRACE;$(DefineConstants) - v4.6 + v4.5 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/tests/unittests/Resources.MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj b/vsintegration/tests/unittests/Resources.MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj index a08b6a2152c..fb538cd4119 100644 --- a/vsintegration/tests/unittests/Resources.MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj +++ b/vsintegration/tests/unittests/Resources.MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj @@ -18,7 +18,7 @@ false False DEBUG;TRACE;$(DefineConstants) - v4.6 + v4.5 true $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/tests/unittests/Resources.MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj b/vsintegration/tests/unittests/Resources.MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj index 8ce558af31f..8a4a98499a6 100644 --- a/vsintegration/tests/unittests/Resources.MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj +++ b/vsintegration/tests/unittests/Resources.MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj @@ -16,7 +16,7 @@ 4 0169;0067 DEBUG;TRACE;$(DefineConstants) - v4.6 + v4.5 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/tests/unittests/Resources.MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj b/vsintegration/tests/unittests/Resources.MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj index 13f6e693aa2..146a33ec40e 100644 --- a/vsintegration/tests/unittests/Resources.MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj +++ b/vsintegration/tests/unittests/Resources.MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj @@ -18,7 +18,7 @@ 58;75 false DEBUG;TRACE;$(DefineConstants) - v4.6 + v4.5 true $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj b/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj index 06007522c03..22d5726da57 100644 --- a/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj +++ b/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj @@ -16,7 +16,7 @@ 4 0169;0067 DEBUG;TRACE;$(DefineConstants) - v4.6 + v4.5 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj b/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj index 1fef6fd080e..70e0ba96b11 100644 --- a/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj +++ b/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj @@ -16,7 +16,7 @@ 4 0169;0067 DEBUG;TRACE;$(DefineConstants) - v4.6 + v4.5 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj b/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj index e237a2c95a9..594a868ab49 100644 --- a/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj +++ b/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj @@ -16,7 +16,7 @@ 4 0169;0067 DEBUG;TRACE;$(DefineConstants) - v4.6 + v4.5 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj b/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj index df4b5baeb97..3d166835dc6 100644 --- a/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj +++ b/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj @@ -16,7 +16,7 @@ 4 0169;0067 DEBUG;TRACE;$(DefineConstants) - v4.6 + v4.5 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj b/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj index 6f83153c461..05d039e94a1 100644 --- a/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj +++ b/vsintegration/tests/unittests/Resources.MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj @@ -16,7 +16,7 @@ 4 0169;0067 DEBUG;TRACE;$(DefineConstants) - v4.6 + v4.5 $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin\UnitTestsResources\MockTypeProviders diff --git a/vsintegration/tests/unittests/Tests.ProjectSystem.UpToDate.fs b/vsintegration/tests/unittests/Tests.ProjectSystem.UpToDate.fs index e70539122ee..5e0550d26bd 100644 --- a/vsintegration/tests/unittests/Tests.ProjectSystem.UpToDate.fs +++ b/vsintegration/tests/unittests/Tests.ProjectSystem.UpToDate.fs @@ -167,7 +167,7 @@ type UpToDate() = File.AppendAllText(proj1Path, TheTests.SimpleFsprojText( ["File1.fs"], // [], // - "v4.6")) // other stuff + "v4.5")) // other stuff use project1 = TheTests.CreateProject(proj1Path) let sourcePath1 = Path.Combine(project1.ProjectFolder, "File1.fs") File.AppendAllText(sourcePath1, "namespace Proj1\r\n") @@ -186,7 +186,7 @@ type UpToDate() = File.AppendAllText(proj2Path, TheTests.SimpleFsprojText( ["File2.fs"], // [output1], // - "v4.6")) // other stuff + "v4.5")) // other stuff use project2 = TheTests.CreateProject(proj2Path) let sourcePath2 = Path.Combine(project2.ProjectFolder, "File2.fs") File.AppendAllText(sourcePath2, "open Proj1\r\n") From 41eb8a858076f250820826fb5ee51a394dd728bd Mon Sep 17 00:00:00 2001 From: Omar Tawfik Date: Tue, 16 Feb 2016 13:12:29 -0800 Subject: [PATCH 08/13] Updated just the vsintegration projects to .net 4.6 --- src/FSharpSource.targets | 24 +++++++++---------- .../FSharp.Data.TypeProviders.fsproj | 1 - .../EnableOpenSource/EnableOpenSource.csproj | 2 +- .../src/FSharp.Editor/FSharp.Editor.fsproj | 1 + .../FSharp.LanguageService.fsproj | 1 + .../Project/ProjectSystem.Base.csproj | 2 +- .../ProjectSystem.fsproj | 1 + .../FSharp.PropertiesPages.vbproj | 2 +- .../tests/Salsa/VisualFSharp.Salsa.fsproj | 1 + .../unittests/VisualFSharp.Unittests.fsproj | 1 + 10 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/FSharpSource.targets b/src/FSharpSource.targets index 7467e638432..cb7fbf53eeb 100644 --- a/src/FSharpSource.targets +++ b/src/FSharpSource.targets @@ -119,7 +119,7 @@ - v3.5 + v3.5 $(DefineConstants);FSHARP_CORE_2_0 $(DefineConstants);RUNTIME $(DefineConstants);FX_ATLEAST_35 @@ -139,7 +139,7 @@ - v4.5 + v4.5 $(DefineConstants);FSHARP_CORE_4_5 $(DefineConstants);FX_ATLEAST_45 $(DefineConstants);FX_ATLEAST_40 @@ -206,7 +206,7 @@ $(DefineConstants);DONT_INCLUDE_DEPRECATED $(DefineConstants);QUERIES_IN_FSLIB Profile47 - v4.0 + v4.0 @@ -242,7 +242,7 @@ $(DefineConstants);FX_EVENTWAITHANDLE_NO_IDISPOSABLE true Profile7 - v4.5 + v4.5 @@ -278,7 +278,7 @@ $(DefineConstants);FX_NO_CONCURRENT_DICTIONARY $(DefineConstants);FX_ATLEAST_LINQ Profile78 - v4.5 + v4.5 @@ -314,12 +314,12 @@ $(DefineConstants);FX_NO_CONCURRENT_DICTIONARY $(DefineConstants);FX_ATLEAST_LINQ Profile259 - v4.5 + v4.5 - v3.0 + v3.0 $(DefineConstants);SILVERLIGHT $(DefineConstants);FX_NO_CANCELLATIONTOKEN_CLASSES $(DefineConstants);FX_NO_EXCEPTIONDISPATCHINFO @@ -399,7 +399,7 @@ $(DefineConstants);PUT_TYPE_PROVIDERS_IN_FSCORE; $(DefineConstants);FX_ATLEAST_LINQ Silverlight - v4.0 + v4.0 v4.0 @@ -442,14 +442,14 @@ $(DefineConstants);FX_ATLEAST_LINQ $(DefineConstants);TARGET_SILVERLIGHT_5_0 Silverlight - v5.0 + v5.0 v5.0 Software\Microsoft\Microsoft SDKs\$(TargetFrameworkIdentifier) $(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\Framework\Silverlight\v5.0 - v4.0 + v4.0 WindowsPhone Silverlight $(DefineConstants);SILVERLIGHT @@ -497,7 +497,7 @@ - v2.0 + v2.0 CompactFramework $(DefineConstants);FX_ATLEAST_COMPACT_FRAMEWORK_20 $(DefineConstants);FX_NO_CANCELLATIONTOKEN_CLASSES @@ -586,7 +586,7 @@ - v3.5 + v3.5 CompactFramework $(DefineConstants);FX_ATLEAST_COMPACT_FRAMEWORK_35 $(DefineConstants);FX_NO_CANCELLATIONTOKEN_CLASSES diff --git a/src/fsharp/FSharp.Data.TypeProviders/FSharp.Data.TypeProviders.fsproj b/src/fsharp/FSharp.Data.TypeProviders/FSharp.Data.TypeProviders.fsproj index ccb67526e5c..810ecac2122 100644 --- a/src/fsharp/FSharp.Data.TypeProviders/FSharp.Data.TypeProviders.fsproj +++ b/src/fsharp/FSharp.Data.TypeProviders/FSharp.Data.TypeProviders.fsproj @@ -11,7 +11,6 @@ Library FSharp.Data.TypeProviders true - v4.0 {cb7d20c4-6506-406d-9144-5342c3595f03} $(OtherFlags) --warnon:1182 diff --git a/vsintegration/deployment/EnableOpenSource/EnableOpenSource.csproj b/vsintegration/deployment/EnableOpenSource/EnableOpenSource.csproj index ac7cee170a2..5249cdb7525 100644 --- a/vsintegration/deployment/EnableOpenSource/EnableOpenSource.csproj +++ b/vsintegration/deployment/EnableOpenSource/EnableOpenSource.csproj @@ -37,7 +37,7 @@ Properties EnableOpenSource EnableOpenSource - v4.5 + v4.6 false false false diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 7ad31fc245e..9371675cfb0 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -5,6 +5,7 @@ ..\..\..\src FSharp true + v4.6 diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index 2b1c58eb72e..9eb0f6864dd 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -5,6 +5,7 @@ ..\..\..\src FSharp true + v4.6 Debug diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj index edb57d4ff23..3e43b652632 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj @@ -17,7 +17,7 @@ {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7} $(DefineConstants);CODE_ANALYSIS;STAMP_OSS_VERSION true - v4.5 + v4.6 $(DefineConstants);FSHARP_CORE_4_5 $(DefineConstants);FX_ATLEAST_45 $(DefineConstants);FX_ATLEAST_40 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj index 45d7cbe1691..e882258a34e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj @@ -7,6 +7,7 @@ true $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\VSSDK 14.0 + v4.6 Debug diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj index c691d52d833..e5f3d3f5254 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj @@ -28,7 +28,7 @@ 40026;42105;42107;42353 true - v4.5 + v4.6 $(DefineConstants),FSHARP_CORE_4_5=True $(DefineConstants),FX_ATLEAST_45=True $(DefineConstants),FX_ATLEAST_40=True diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index b77bc4791fd..70be31ae40c 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -6,6 +6,7 @@ FSharp true VisualFSharp.Salsa + v4.6 diff --git a/vsintegration/tests/unittests/VisualFSharp.Unittests.fsproj b/vsintegration/tests/unittests/VisualFSharp.Unittests.fsproj index 1b7609ba006..38fcc5afe42 100644 --- a/vsintegration/tests/unittests/VisualFSharp.Unittests.fsproj +++ b/vsintegration/tests/unittests/VisualFSharp.Unittests.fsproj @@ -6,6 +6,7 @@ FSharp true VisualFSharp.Unittests + v4.6 From 44ecd52e6535dd169a301b2b5cf777ae9c01c3f5 Mon Sep 17 00:00:00 2001 From: Omar Tawfik Date: Wed, 17 Feb 2016 17:39:02 -0800 Subject: [PATCH 09/13] Replaced old language service with roslyn based service --- .gitignore | 3 +- .../src/FSharp.Editor/BraceCompletion.fs | 2 +- .../src/FSharp.Editor/FSharp.Editor.fsproj | 4 +- ...lynContentType.fs => FSharpContentType.fs} | 10 +- ...Service.fs => FSharpProjectSiteService.fs} | 6 +- .../src/FSharp.Editor/SmartIndent.fs | 2 +- .../FSRoslynLanguageService.fs | 83 --- .../FSharp.LanguageService.fsproj | 4 +- .../FSharpLanguageService.fs | 670 +++--------------- .../FSharp.LanguageService/FSharpPackage.fs | 141 ---- ...SRoslynProject.fs => FSharpProjectSite.fs} | 10 +- .../LanguageServiceUtils.fs | 24 +- .../FSharp.ProjectSystem.FSharp/Project.fs | 2 +- 13 files changed, 112 insertions(+), 849 deletions(-) rename vsintegration/src/FSharp.Editor/{FSRoslynContentType.fs => FSharpContentType.fs} (57%) rename vsintegration/src/FSharp.Editor/{FSRoslynProjectSiteService.fs => FSharpProjectSiteService.fs} (85%) delete mode 100644 vsintegration/src/FSharp.LanguageService/FSRoslynLanguageService.fs delete mode 100644 vsintegration/src/FSharp.LanguageService/FSharpPackage.fs rename vsintegration/src/FSharp.LanguageService/{FSRoslynProject.fs => FSharpProjectSite.fs} (87%) diff --git a/.gitignore b/.gitignore index e4d0670940f..0733a5fdbce 100644 --- a/.gitignore +++ b/.gitignore @@ -78,8 +78,7 @@ tests/*FSharp_Failures.lst tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Module01.dll tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Module01.pdb tests/XFSharpQA_Failures.log.* -vsintegration/src/vs/FsPkgs/FSharp.Project/FS/FSharp.ProjectSystem.FSharp.fsi -vsintegration/src/vs/FsPkgs/FSharp.Project/FS/ctofiles/ +vsintegration/src/FSharp.ProjectSystem.FSharp/ctofiles tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Utils.dll tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExprLibrary.dll tests/fsharpqa/Source/*FSharpQA_Failures.env diff --git a/vsintegration/src/FSharp.Editor/BraceCompletion.fs b/vsintegration/src/FSharp.Editor/BraceCompletion.fs index 4dff3674067..87acf7a3094 100644 --- a/vsintegration/src/FSharp.Editor/BraceCompletion.fs +++ b/vsintegration/src/FSharp.Editor/BraceCompletion.fs @@ -24,7 +24,7 @@ type internal CompletionContext(tokenContext : TokenContext, textManager : IVsTe /// Called when user hits Return while inside of a brace completion session. member this.OnReturn(session) = - let lp = [| LANGPREFERENCES(guidLang = Guid(FSharpCommonConstants.languageServiceGuidString)) |] + let lp = [| LANGPREFERENCES(guidLang = Guid(FSharpCommonConstants.languageServiceGuid)) |] ErrorHandler.ThrowOnFailure(textManager.GetUserPreferences(null, null, lp, null)) |> ignore // if smart indent is not enabled, or we are in a string, don't do any special formatting diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 9371675cfb0..39544c4d460 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -28,8 +28,8 @@ false - - + + diff --git a/vsintegration/src/FSharp.Editor/FSRoslynContentType.fs b/vsintegration/src/FSharp.Editor/FSharpContentType.fs similarity index 57% rename from vsintegration/src/FSharp.Editor/FSRoslynContentType.fs rename to vsintegration/src/FSharp.Editor/FSharpContentType.fs index 467e0973340..849f1587fc9 100644 --- a/vsintegration/src/FSharp.Editor/FSRoslynContentType.fs +++ b/vsintegration/src/FSharp.Editor/FSharpContentType.fs @@ -9,16 +9,16 @@ open Microsoft.VisualStudio.Utilities open Microsoft.VisualStudio.FSharp.LanguageService -module FSRoslynStaticTypeDefinitions = +module FSharpStaticTypeDefinitions = [] [] [] - let FSRoslynContentTypeDefinition = ContentTypeDefinition() + let FSharpContentTypeDefinition = ContentTypeDefinition() -[] -type FSRoslynContentTypeLanguageService [](contentTypeRegistry : IContentTypeRegistryService) = +[] +type FSharpContentType [](contentTypeRegistry : IContentTypeRegistryService) = member this.contentTypeRegistryService = contentTypeRegistry interface IContentTypeLanguageService with member this.GetDefaultContentType() = - this.contentTypeRegistryService.GetContentType(FSRoslynCommonConstants.FSharpContentType); + this.contentTypeRegistryService.GetContentType(FSharpCommonConstants.FSharpContentTypeName); \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/FSRoslynProjectSiteService.fs b/vsintegration/src/FSharp.Editor/FSharpProjectSiteService.fs similarity index 85% rename from vsintegration/src/FSharp.Editor/FSRoslynProjectSiteService.fs rename to vsintegration/src/FSharp.Editor/FSharpProjectSiteService.fs index 285a808b9b3..7804d1c12cf 100644 --- a/vsintegration/src/FSharp.Editor/FSRoslynProjectSiteService.fs +++ b/vsintegration/src/FSharp.Editor/FSharpProjectSiteService.fs @@ -19,13 +19,13 @@ open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem type internal IHostProjectService = inherit IWorkspaceService - abstract member GetHostProject : id : ProjectId -> FSRoslynProject + abstract member GetHostProject : id : ProjectId -> FSharpProjectSite [, ServiceLayer.Default); Shared>] -type internal FSRoslynProjectSiteService [] (vsWorkspace : VisualStudioWorkspaceImpl) = +type internal FSharpProjectSiteService [] (vsWorkspace : VisualStudioWorkspaceImpl) = interface IWorkspaceServiceFactory with member this.CreateService(_) = upcast this interface IHostProjectService with member this.GetHostProject(id:ProjectId) = - downcast vsWorkspace.GetHostProject(id) + downcast vsWorkspace.GetHostProject(id) \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/SmartIndent.fs b/vsintegration/src/FSharp.Editor/SmartIndent.fs index 1c9b1636fe2..018fbd09024 100644 --- a/vsintegration/src/FSharp.Editor/SmartIndent.fs +++ b/vsintegration/src/FSharp.Editor/SmartIndent.fs @@ -49,7 +49,7 @@ type SmartIndent (textView : ITextView, textManager : IVsTextManager) = /// or null when no indentation is desired or unable to determine indentation member this.GetDesiredIndentation(line : ITextSnapshotLine) = - let lp = [| LANGPREFERENCES(guidLang = Guid(FSharpCommonConstants.languageServiceGuidString)) |] + let lp = [| LANGPREFERENCES(guidLang = Guid(FSharpCommonConstants.languageServiceGuid)) |] let indentStyle = if ErrorHandler.Succeeded(textManager.GetUserPreferences(null, null, lp, null)) then lp.[0].IndentStyle else vsIndentStyle.vsIndentStyleDefault if (indentStyle = vsIndentStyle.vsIndentStyleNone || _textView = null || _textView.IsClosed) then diff --git a/vsintegration/src/FSharp.LanguageService/FSRoslynLanguageService.fs b/vsintegration/src/FSharp.LanguageService/FSRoslynLanguageService.fs deleted file mode 100644 index a1c8946cbfa..00000000000 --- a/vsintegration/src/FSharp.LanguageService/FSRoslynLanguageService.fs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.VisualStudio.FSharp.LanguageService - -open System -open System.Collections.Generic -open System.Runtime.InteropServices - -open Microsoft.FSharp.Compiler.SourceCodeServices - -open Microsoft.CodeAnalysis -open Microsoft.CodeAnalysis.SolutionCrawler -open Microsoft.VisualStudio -open Microsoft.VisualStudio.LanguageServices -open Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService -open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem -open Microsoft.VisualStudio.LanguageServices.Implementation -open Microsoft.VisualStudio.Shell -open Microsoft.VisualStudio.Shell.Interop - -[] -type FSRoslynLanguageService(package : FSRoslynPackage) = - inherit AbstractLanguageService(package) - - override this.ContentTypeName = FSRoslynCommonConstants.FSharpContentType - override this.LanguageName = FSRoslynCommonConstants.FSharpLanguageName - override this.RoslynLanguageName = FSRoslynCommonConstants.FSharpLanguageName - - override this.LanguageServiceId = new Guid(FSRoslynCommonConstants.languageServiceGuid) - override this.DebuggerLanguageId = DebuggerEnvironment.GetLanguageID() - - override this.CreateContext(_,_,_,_,_) = raise(System.NotImplementedException()) - - override this.SetupNewTextView(view) = - base.SetupNewTextView(view) - let workspace = this.Package.ComponentModel.GetService(); - let sp = new ServiceProvider(this.SystemServiceProvider.GetService()) - - // Ensure that we have a project in the workspace for this document. - let (_, buffer) = view.GetBuffer() - let filename = VsTextLines.GetFilename buffer - let result = VsRunningDocumentTable.FindDocumentWithoutLocking(sp.RunningDocumentTable,filename) - match result with - | Some (hier, _) -> - match hier with - | :? IProvideProjectSite as siteProvider -> - let site = siteProvider.GetProjectSite() - - let projectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(site.ProjectFileName(), site.ProjectFileName()) - if obj.ReferenceEquals(workspace.ProjectTracker.GetProject(projectId), null) then - let project = new FSRoslynProject(hier, this.SystemServiceProvider, workspace, site.ProjectFileName()); - project.Initialize(hier, site) - | _ -> () - | _ -> () - -and [] - FSharpEditorFactory(package : FSRoslynPackage) = - inherit AbstractEditorFactory(package) - - override this.ContentTypeName = FSRoslynCommonConstants.FSharpContentType - override this.GetFormattedTextChanges(_, _, _, _) = System.Collections.Generic.List() :> System.Collections.Generic.IList - -and [] - FSRoslynPackage() = - inherit AbstractPackage() - - override this.RoslynLanguageName = FSRoslynCommonConstants.FSharpLanguageName - - override this.Initialize() = - if LanguageServiceUtils.shouldEnableRoslynLanguageService then - base.Initialize() - - override this.CreateWorkspace() = this.ComponentModel.GetService() - - override this.CreateLanguageService() = - let language = new FSRoslynLanguageService(this) - language - - override this.CreateEditorFactories() = - //let factory = FSharpEditorFactory(this) :> IVsEditorFactory - [] :> IEnumerable - - override this.RegisterMiscellaneousFilesWorkspaceInformation(_) = () diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index 9eb0f6864dd..8bb56099eb4 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -39,10 +39,8 @@ + - - - diff --git a/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs b/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs index 9e5444cd9a9..0d944b7ce1a 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs +++ b/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs @@ -3,616 +3,110 @@ namespace Microsoft.VisualStudio.FSharp.LanguageService open System -open System.IO open System.Collections.Generic -open System.Configuration -open System.Globalization open System.Runtime.InteropServices -open Microsoft.VisualStudio -open Microsoft.VisualStudio.Shell -open Microsoft.VisualStudio.Shell.Interop -open Microsoft.VisualStudio.TextManager.Interop -open Microsoft.VisualStudio.Text -open Microsoft.VisualStudio.OLE.Interop -open Microsoft.FSharp.Compiler -open Microsoft.FSharp.Compiler.SourceCodeServices - -// This is the list of known owners of callbacks that may register themselves. -// Consumers not in this list should use a GUID our some other strongly unique key string -module internal KnownAdviseProjectSiteChangesCallbackOwners = - let LanguageService = "F# Language Service" - -module internal FSharpCommonConstants = - [] - let languageServiceGuidString = "BC6DD5A5-D4D6-4dab-A00D-A51242DBAF1B" - - -module internal FSharpConstants = - let fsharpLanguageName = "F#" - - // These are the IDs from fslangservice.dll - let packageGuidString = "871D2A70-12A2-4e42-9440-425DD92A4116" - [] - let languageServiceGuidString = FSharpCommonConstants.languageServiceGuidString - - // These are the IDs from the Python sample: - let intellisenseProviderGuidString = "8b1807ea-d222-4765-afa8-c092d480e451" - - // These are the entries from fslangservice.dll - let PLKMinEdition = "standard" - let PLKCompanyName = "Microsoft" // "Microsoft Corporation" - let PLKProductName = "f#" // "Visual Studio Integration of FSharp Language Service" - let PLKProductVersion = "1.0" - let PLKResourceID = 1s - -/// This class defines capabilities of the language service. -/// CodeSense = true\false, for example -type internal FSharpLanguagePreferences(site, langSvc, name) = - inherit LanguagePreferences(site, langSvc, name) - -// Container class that delays loading of FSharp.Compiler.dll compiler types until they're actually needed -type internal FSharpCheckerContainer(checker) = - member this.FSharpChecker = checker - -/// LanguageService state. -type internal FSharpLanguageServiceTestable() as this = - static let colorizerGuid = new Guid("{A2976312-7D71-4BB4-A5F8-66A08EBF46C8}") // Guid for colorizwed user data on IVsTextBuffer - let mutable checkerContainerOpt : FSharpCheckerContainer option = None - let mutable artifacts : ProjectSitesAndFiles option = None - let mutable serviceProvider : System.IServiceProvider option = None - let mutable preferences : LanguagePreferences option = None - let mutable documentationBuilder : IDocumentationBuilder option = None - let mutable sourceFactory : (IVsTextLines -> IFSharpSource) option = None - let mutable dirtyForTypeCheckFiles : Set = Set.empty - let mutable isInitialized = false - let mutable unhooked = false - let getColorizer (view:IVsTextView) = - let buffer = Com.ThrowOnFailure1(view.GetBuffer()) - this.GetColorizer(buffer) +open Microsoft.FSharp.Compiler.SourceCodeServices - let bgRequests = new FSharpLanguageServiceBackgroundRequests(getColorizer,(fun () -> this.FSharpChecker),(fun () -> this.ProjectSitesAndFiles),(fun () -> this.ServiceProvider),(fun () -> this.DocumentationBuilder)) - - member this.FSharpChecker = - if this.Unhooked then raise Error.UseOfUnhookedLanguageServiceState - if not this.IsInitialized then raise Error.UseOfUninitializedLanguageServiceState - checkerContainerOpt.Value.FSharpChecker +open Microsoft.CodeAnalysis +open Microsoft.CodeAnalysis.SolutionCrawler +open Microsoft.VisualStudio +open Microsoft.VisualStudio.LanguageServices +open Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService +open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem +open Microsoft.VisualStudio.LanguageServices.Implementation +open Microsoft.VisualStudio.Shell +open Microsoft.VisualStudio.Shell.Interop - member this.ServiceProvider = - if this.Unhooked then raise Error.UseOfUnhookedLanguageServiceState - if not this.IsInitialized then raise Error.UseOfUninitializedLanguageServiceState - serviceProvider.Value +// Workaround to access non-public settings persistence type. +// GetService( ) with this will work as long as the GUID matches the real type. +[] +type internal SVsSettingsPersistenceManager = class end - member this.ProjectSitesAndFiles = - if not this.IsInitialized then raise Error.UseOfUninitializedLanguageServiceState - artifacts.Value - - member this.Preferences = - if this.Unhooked then raise Error.UseOfUnhookedLanguageServiceState - if not this.IsInitialized then raise Error.UseOfUninitializedLanguageServiceState - preferences.Value - - member this.SourceFactory = - if this.Unhooked then raise Error.UseOfUnhookedLanguageServiceState - if not this.IsInitialized then raise Error.UseOfUninitializedLanguageServiceState - sourceFactory.Value - - member this.IsInitialized = isInitialized - member this.Unhooked = unhooked - member this.DocumentationBuilder = documentationBuilder.Value - - /// Handle late intialization pieces - member this.Initialize (sp, dp, prefs, sourceFact) = - if this.Unhooked then raise Error.UseOfUnhookedLanguageServiceState - artifacts <- Some (ProjectSitesAndFiles()) - let checker = FSharpChecker.Create() - checker.BeforeBackgroundFileCheck.Add (fun filename -> UIThread.Run(fun () -> this.NotifyFileTypeCheckStateIsDirty(filename))) - checkerContainerOpt <- Some (FSharpCheckerContainer checker) - serviceProvider <- Some sp - isInitialized <- true - unhooked <- false - documentationBuilder <- Some dp - preferences <- Some prefs - sourceFactory <- Some sourceFact +[] +type FSharpLanguageService(package : FSharpPackage) = + inherit AbstractLanguageService(package) - - member this.NotifyFileTypeCheckStateIsDirty(filename) = - dirtyForTypeCheckFiles <- dirtyForTypeCheckFiles.Add filename + override this.ContentTypeName = FSharpCommonConstants.FSharpContentTypeName + override this.LanguageName = FSharpCommonConstants.FSharpLanguageName + override this.RoslynLanguageName = FSharpCommonConstants.FSharpLanguageName - /// Clear all language service caches and finalize all transient references to compiler objects - member this.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() = - if this.Unhooked then raise Error.UseOfUnhookedLanguageServiceState - if this.IsInitialized then - this.FSharpChecker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() + override this.LanguageServiceId = new Guid(FSharpCommonConstants.languageServiceGuid) + override this.DebuggerLanguageId = DebuggerEnvironment.GetLanguageID() - /// Unhook the object. These are the held resources that need to be disposed. - member this.Unhook() = - if this.Unhooked then raise Error.UseOfUnhookedLanguageServiceState - if this.IsInitialized then - // Dispose the preferences. - if this.Preferences <> null then this.Preferences.Dispose() - // Stop the background compile. - // here we refer to checkerContainerOpt directly to avoid triggering its creation - match checkerContainerOpt with - | Some container -> - let checker = container.FSharpChecker - checker.StopBackgroundCompile() - checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() - | None -> () - - checkerContainerOpt <- None - artifacts <- None - preferences <- None - documentationBuilder <- None - unhooked <- true - sourceFactory <- None - serviceProvider <- None - - /// Respond to project settings changes - member this.OnProjectSettingsChanged(site:IProjectSite) = - // The project may have changed its references. These would be represented as 'dependency files' of each source file. Each source file will eventually start listening - // for changes to those dependencies, at which point we'll get OnDependencyFileCreateOrDelete notifications. Until then, though, we just 'make a note' that this project is out of date. - bgRequests.AddOutOfDateProjectFileName(site.ProjectFileName()) - for filename in site.SourceFilesOnDisk() do - let rdt = this.ServiceProvider.RunningDocumentTable - match this.ProjectSitesAndFiles.TryGetSourceOfFile(rdt,filename) with - | Some source -> - source.RecolorizeWholeFile() - source.RecordChangeToView() - | None -> () + override this.CreateContext(_,_,_,_,_) = raise(System.NotImplementedException()) - /// Respond to project being cleaned/rebuilt (any live type providers in the project should be refreshed) - member this.OnProjectCleaned(projectSite:IProjectSite) = - let checkOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(projectSite, "") - this.FSharpChecker.NotifyProjectCleaned(checkOptions) + override this.SetupNewTextView(view) = + base.SetupNewTextView(view) + let workspace = this.Package.ComponentModel.GetService(); + let sp = new ServiceProvider(this.SystemServiceProvider.GetService()) - member this.OnActiveViewChanged(textView) = - bgRequests.OnActiveViewChanged(textView) - - member this.BackgroundRequests = bgRequests - - /// Unittestable complement to LanguageServce.CreateSource - member this.CreateSource(buffer:IVsTextLines) : IFSharpSource = - - // Each time a source is created, also verify that the IProjectSite has been initialized to listen to changes to the project. - // We can't listen to OnProjectLoaded because the language service is not guaranteed to be loaded when this is called. + // Ensure that we have a project in the workspace for this document. + let (_, buffer) = view.GetBuffer() let filename = VsTextLines.GetFilename buffer - let rdt = this.ServiceProvider.RunningDocumentTable - let result = VsRunningDocumentTable.FindDocumentWithoutLocking(rdt,filename) - match result with - | Some(hier,_) -> - match hier with + let result = VsRunningDocumentTable.FindDocumentWithoutLocking(sp.RunningDocumentTable,filename) + match result with + | Some (hier, _) -> + match hier with | :? IProvideProjectSite as siteProvider -> let site = siteProvider.GetProjectSite() - site.AdviseProjectSiteChanges(KnownAdviseProjectSiteChangesCallbackOwners.LanguageService, - new AdviseProjectSiteChanges(fun () -> this.OnProjectSettingsChanged(site))) - site.AdviseProjectSiteCleaned(KnownAdviseProjectSiteChangesCallbackOwners.LanguageService, - new AdviseProjectSiteChanges(fun () -> this.OnProjectCleaned(site))) - | _ -> - // This can happen when the file is in a solution folder or in, say, a C# project. - () - | _ -> - // This can happen when renaming a file from a different language service into .fs or fsx. - // This naturally won't have an associated project. - () - - // Create the source and register file change callbacks there. - let source = this.SourceFactory(buffer) - this.ProjectSitesAndFiles.SetSource(buffer, source) - source - - // For each change in dependency files, notify the language service of the change and propagate the update - interface IDependencyFileChangeNotify with - member this.DependencyFileCreated projectSite = - // Invalidate the configuration if we notice any add for any DependencyFiles - let checkOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(projectSite, "") - this.FSharpChecker.InvalidateConfiguration(checkOptions) - - member this.DependencyFileChanged (filename) = - this.NotifyFileTypeCheckStateIsDirty filename + let projectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(site.ProjectFileName(), site.ProjectFileName()) + if obj.ReferenceEquals(workspace.ProjectTracker.GetProject(projectId), null) then + let projectSite = new FSharpProjectSite(hier, this.SystemServiceProvider, workspace, site.ProjectFileName()); + projectSite.Initialize(hier, site) + | _ -> () + | _ -> () - /// Do OnIdle processing for the whole language service. dirtyForTypeCheckFiles can be set by events - /// raised on the background compilation thread. - member this.OnIdle() = - for file in dirtyForTypeCheckFiles do - let rdt = this.ServiceProvider.RunningDocumentTable - match this.ProjectSitesAndFiles.TryGetSourceOfFile(rdt, file) with - | Some source -> source.RecordChangeToView() - | None -> () - dirtyForTypeCheckFiles <- Set.empty - +and [] + FSharpEditorFactory(package : FSharpPackage) = + inherit AbstractEditorFactory(package) - /// Remove a colorizer. - member this.CloseColorizer(colorizer:FSharpColorizer) = - let buffer = colorizer.Buffer - let mutable guid = colorizerGuid - (buffer :?> IVsUserData).SetData(&guid, null) |> ErrorHandler.ThrowOnFailure |> ignore + override this.ContentTypeName = FSharpCommonConstants.FSharpContentTypeName + override this.GetFormattedTextChanges(_, _, _, _) = System.Collections.Generic.List() :> System.Collections.Generic.IList - /// Get a colorizer for a particular buffer. - member this.GetColorizer(buffer:IVsTextLines) : FSharpColorizer = - let mutable guid = colorizerGuid - let mutable colorizerObj = null - - (buffer :?> IVsUserData).GetData(&guid, &colorizerObj) |> ignore - match colorizerObj with - | null -> - let scanner = - new FSharpScanner(fun source -> - // Note: in theory, the next few lines do not need to be recomputed every line. Instead we could just cache the tokenizer - // and only update it when e.g. the project system notifies us there is an important change (e.g. a file rename, etc). - // In practice we have been there, and always screwed up some non-unit-tested/testable corner-cases. - // So this is not ideal from a perf perspective, but it is easy to reason about the correctness. - let filename = VsTextLines.GetFilename buffer - let rdt = this.ServiceProvider.RunningDocumentTable - let defines = this.ProjectSitesAndFiles.GetDefinesForFile(rdt, filename) - let sourceTokenizer = FSharpSourceTokenizer(defines,filename) - sourceTokenizer.CreateLineTokenizer(source)) - - let colorizer = new FSharpColorizer(this.CloseColorizer, buffer, scanner) - (buffer :?> IVsUserData).SetData(&guid, colorizer) |> ErrorHandler.ThrowOnFailure |> ignore - colorizer - | _ -> colorizerObj :?> FSharpColorizer +and [] + FSharpPackage() = + inherit AbstractPackage() - /// Block until the background compile finishes. - // - // This is for unit testing only - member this.WaitForBackgroundCompile() = - this.FSharpChecker.WaitForBackgroundCompile() + override this.RoslynLanguageName = FSharpCommonConstants.FSharpLanguageName -module internal VsConstants = - let guidStdEditor = new Guid("9ADF33D0-8AAD-11D0-B606-00A0C922E851") - let guidCodeCloneProvider = new Guid("38fd587e-d4b7-4030-9a95-806ff0d5c2c6") + override this.Initialize() = + base.Initialize() + this.EstablishDefaultSettingsIfMissing() - let cmdidGotoDecl = 936u // "Go To Declaration" - let cmdidGotoRef = 1107u // "Go To Reference" + override this.CreateWorkspace() = this.ComponentModel.GetService() - let IDM_VS_EDITOR_CSCD_OUTLINING_MENU = 773u // "Outlining" - let ECMD_OUTLN_HIDE_SELECTION = 128u // "Hide Selection" - - let ECMD_OUTLN_TOGGLE_CURRENT = 129u // "Toggle Outlining Expansion" - - let ECMD_OUTLN_TOGGLE_ALL = 130u // "Toggle All Outlining" - let ECMD_OUTLN_STOP_HIDING_ALL = 131u // "Stop Outlining" - let ECMD_OUTLN_STOP_HIDING_CURRENT = 132u // "Stop Hiding Current" - -type private QueryStatusResult = - | NOTSUPPORTED = 0 - | SUPPORTED = 1 - | ENABLED = 2 - | LATCHED = 4 - | NINCHED = 8 - | INVISIBLE = 16 - -type internal FSharpViewFilter(mgr:CodeWindowManager,view:IVsTextView) = - inherit ViewFilter(mgr,view) - - override this.Dispose() = base.Dispose() + override this.CreateLanguageService() = + let language = new FSharpLanguageService(this) + language - member this.IsSupportedCommand(guidCmdGroup:byref,cmd:uint32) = - if guidCmdGroup = VsMenus.guidStandardCommandSet97 && (cmd = VsConstants.cmdidGotoDecl || cmd = VsConstants.cmdidGotoRef) then false - elif guidCmdGroup = VsConstants.guidCodeCloneProvider then false // disable commands for CodeClone package - else - // These are all the menu options in the "Outlining" cascading menu. We need to disable all the individual - // items to disable the cascading menu. QueryCommandStatus does not get called for the cascading menu itself. - assert((guidCmdGroup = VsConstants.guidStdEditor && cmd = VsConstants.IDM_VS_EDITOR_CSCD_OUTLINING_MENU) = false) - if guidCmdGroup = VsMenus.guidStandardCommandSet2K && (cmd = VsConstants.ECMD_OUTLN_HIDE_SELECTION || - cmd = VsConstants.ECMD_OUTLN_TOGGLE_CURRENT || - cmd = VsConstants.ECMD_OUTLN_TOGGLE_ALL || - cmd = VsConstants.ECMD_OUTLN_STOP_HIDING_ALL || - cmd = VsConstants.ECMD_OUTLN_STOP_HIDING_CURRENT) then false - else true + override this.CreateEditorFactories() = + [] :> IEnumerable - override this.QueryCommandStatus(guidCmdGroup:byref,cmd:uint32) = - if this.IsSupportedCommand(&guidCmdGroup,cmd) then - base.QueryCommandStatus(&guidCmdGroup,cmd) - else - // Hide the menu item. Just returning QueryStatusResult.NOTSUPPORTED does not work - QueryStatusResult.INVISIBLE ||| QueryStatusResult.SUPPORTED |> int - - -[] -type internal FSharpLanguageService() as fls = - inherit LanguageService() - - let ls = FSharpLanguageServiceTestable() - let mutable rdtCookie = VSConstants.VSCOOKIE_NIL - - let thisAssembly = typeof.Assembly - let resources = lazy (new System.Resources.ResourceManager("VSPackage", thisAssembly)) - let GetString(name:string) = resources.Force().GetString(name, CultureInfo.CurrentUICulture) - - let navigation = FSharpNavigationController() - - let formatFilterList = lazy( - let fsFile = GetString("FSharpFile") - let fsInterfaceFile = GetString("FSharpInterfaceFile") - let fsxFile = GetString("FSXFile") - let fsScriptFile = GetString("FSharpScriptFile") - let result = sprintf "%s|*.fs\n%s|*.fsi\n%s|*.fsx\n%s|*.fsscript" - fsFile fsInterfaceFile fsxFile fsScriptFile - result) + override this.RegisterMiscellaneousFilesWorkspaceInformation(_) = () - // This array contains the definition of the colorable items provided by this - // language service. - let colorableItems = [| - // See e.g. the TokenColor type defined in Scanner.cs. Position 0 is implicit and always means "Plain Text". - // The next 5 items in this list MUST be these default items in this order: - new FSharpColorableItem("Keyword", lazy (GetString("Keyword")), COLORINDEX.CI_BLUE, COLORINDEX.CI_USERTEXT_BK) - new FSharpColorableItem("Comment", lazy (GetString("Comment")), COLORINDEX.CI_DARKGREEN, COLORINDEX.CI_USERTEXT_BK) - new FSharpColorableItem("Identifier", lazy (GetString("Identifier")), COLORINDEX.CI_USERTEXT_FG, COLORINDEX.CI_USERTEXT_BK) - new FSharpColorableItem("String", lazy (GetString("String")), COLORINDEX.CI_MAROON, COLORINDEX.CI_USERTEXT_BK) - new FSharpColorableItem("Number", lazy (GetString("Number")), COLORINDEX.CI_USERTEXT_FG, COLORINDEX.CI_USERTEXT_BK) - // User-defined color classes go here: - new FSharpColorableItem("Excluded Code", lazy (GetString("ExcludedCode")), COLORINDEX.CI_DARKGRAY, COLORINDEX.CI_USERTEXT_BK) - new FSharpColorableItem("Preprocessor Keyword", lazy (GetString("PreprocessorKeyword")), COLORINDEX.CI_BLUE, COLORINDEX.CI_USERTEXT_BK) - new FSharpColorableItem("Operator", lazy (GetString("Operator")), COLORINDEX.CI_USERTEXT_FG, COLORINDEX.CI_USERTEXT_BK) - |] - - let sourceFactory(buffer:IVsTextLines) = - let vsFileWatch = fls.GetService(typeof) :?> IVsFileChangeEx - Source.CreateSource(fls, buffer, fls.GetColorizer(buffer), vsFileWatch, ls :> IDependencyFileChangeNotify, (fun () -> ls.FSharpChecker)) - - let refreshUI() = - let uiShell = fls.Site.GetService() - if (uiShell <> null) then - uiShell.UpdateCommandUI(0) |> ignore - - - /// Initialize the language service - override fls.Initialize() = - if not ls.IsInitialized then - let preferences = new FSharpLanguagePreferences(fls.Site, (typeof).GUID, FSharpConstants.fsharpLanguageName) - preferences.Init() // Reads preferences from the VS registry. - preferences.MaxErrorMessages <- 1000 - - let serviceProvider = fls.Site - let docBuilder = XmlDocumentation.CreateDocumentationBuilder(serviceProvider.XmlService, serviceProvider.DTE) - - ls.Initialize(serviceProvider, docBuilder, preferences, sourceFactory) - - rdtCookie <- (Com.ThrowOnFailure1 (serviceProvider.RunningDocumentTable.AdviseRunningDocTableEvents (fls:>IVsRunningDocTableEvents))) - - - override fls.Dispose() = - try - try - if rdtCookie <> VSConstants.VSCOOKIE_NIL then - let rdt = fls.Site.RunningDocumentTable - Com.ThrowOnFailure0 (rdt.UnadviseRunningDocTableEvents rdtCookie) - finally - if ls.IsInitialized then - ls.Unhook() - finally - base.Dispose() - - member fls.Core = ls - - // ----------------------------------------------------------------------- - // Implement IVsLanguageInfo - - interface IVsLanguageInfo with - /// Allows a language to add adornments to a code editor. - member this.GetCodeWindowManager(codeWindow, mgr) = - fls.Initialize(); - let mutable buffer = null; - NativeMethods.ThrowOnFailure(codeWindow.GetBuffer(&buffer)) |> ignore; - // see if we already have a Source object. - let source = - match this.GetSource(buffer) with - | null -> - let s = ls.CreateSource(buffer) :?> ISource - this.sources.Add(s) |> ignore; - s - | s -> s - - mgr <- this.CreateCodeWindowManager(codeWindow, source); - NativeMethods.S_OK; - - /// Returns the colorizer. - member this.GetColorizer(buffer, result) = - result <- this.GetColorizer(buffer) - NativeMethods.S_OK - - /// Returns the file extensions belonging to this language. - member this.GetFileExtensions(extensions) = - extensions <- "" - NativeMethods.S_OK - - member this.GetLanguageName(name) = - name <- FSharpConstants.fsharpLanguageName - NativeMethods.S_OK - - // ----------------------------------------------------------------------- - // Implement LanguageService base methods from the C# code - - override fls.OnActiveViewChanged(textView) = - base.OnActiveViewChanged(textView) - ls.OnActiveViewChanged(textView) - if navigation.EnableNavBar || navigation.EnableRegions then - match fls.GetSource(textView) with - | null -> () - | source -> ls.BackgroundRequests.TriggerParseFile(textView, source) |> ignore - - - // Provides the index to the filter matching the extension of the file passed in. - override fls.CurFileExtensionFormat(filename) = - // These indexes match the "GetFormatFilterList" function - match Path.GetExtension(filename) with - | ".fs" -> 0 - | ".ml" -> 1 - | ".fsi" -> 2 - | ".mli" -> 3 - | ".fsx" -> 4 - | ".fsscript" -> 5 - | _ -> -1 - - /// Provides the list of available extensions for Save As. - /// The following default filter string is automatically added by Visual Studio: - /// "All Files (*.*)\n*.*\nText Files (*.txt)\n*.txt\n" - override fls.GetFormatFilterList() = - formatFilterList.Value - - // This seems to be called by codeWinMan.OnNewView(textView) to install a ViewFilter on the TextView. - override this.CreateViewFilter(mgr:CodeWindowManager,newView:IVsTextView) = new FSharpViewFilter(mgr,newView) :> ViewFilter - - override fls.GetLanguagePreferences() = ls.Preferences - - override fls.CreateBackgroundRequest(line, col, info, sourceText, snapshot, methodTipMiscellany, fname, reason, view, sink, source, timestamp, synchronous) = - ls.BackgroundRequests.CreateBackgroundRequest(line, col, info, sourceText, snapshot, methodTipMiscellany, fname,reason, view,sink, source, timestamp, synchronous) :> BackgroundRequest - - /// Handle an incoming request to analyze a file. - /// - /// Executed either on the UI thread (for req.IsSynchronous) or the background request thread. - override fls.ExecuteBackgroundRequest(req:BackgroundRequest) = - ls.BackgroundRequests.ExecuteBackgroundRequest(req :?> FSharpBackgroundRequest, req.Source :?> IFSharpSource) - - // Check if we can shortcut executing the background request and just fill in the latest - // cached scope for the active view from this.service.RecentFullTypeCheckResults. - // - // THIS MUST ONLY RETURN TRUE IF ---> ExecuteBackgroundRequest is equivalent to fetching a recent, - // perhaps out-of-date scope. - override fls.IsRecentScopeSufficientForBackgroundRequest(reason) = - ls.BackgroundRequests.IsRecentScopeSufficientForBackgroundRequest(reason) - - // This is called on the UI thread after fresh full typecheck results are available - override fls.OnParseFileOrCheckFileComplete( req:BackgroundRequest) = - if (req <> null && req.Source <> null && not req.Source.IsClosed) then - fls.SetUserContextDirty(req.FileName) - refreshUI() - ls.BackgroundRequests.OnParseFileOrCheckFileComplete(req, navigation.EnableRegions, fls.LastActiveTextView) - - override fls.GetColorizer(buffer) = - fls.Initialize() - ls.GetColorizer(buffer) :> Colorizer - - - override fls.CreateDropDownHelper(_view) = - if navigation.EnableNavBar then - (new FSharpNavigationBars(fls, fun () -> ls.BackgroundRequests.NavigationBarAndRegionInfo)) :> TypeAndMemberDropdownBars - else null - - /// Do OnIdle processing - override fls.OnIdle(periodic, mgr : IOleComponentManager) = - try - let r = base.OnIdle(periodic, mgr) - ls.OnIdle() - r - with e-> - Assert.Exception(e) - reraise() - - // ----------------------------------------------------------------------- - // Implement IVsLanguageDebugInfo - - /// This is used to return the expression evaluator language to the debugger - interface IVsLanguageDebugInfo with - // Returns the corresponding debugger back-end "language ID". - member fls.GetLanguageID(_buffer,_line, _col, langId) = - langId <- DebuggerEnvironment.GetLanguageID() - VSConstants.S_OK - - // Deprecated. Do not use. - member fls.GetLocationOfName(_name, pbstrMkDoc, _spans) = - pbstrMkDoc <- null - NativeMethods.E_NOTIMPL - - // Generates a name for the given location in the file. - member fls.GetNameOfLocation(_buffer, _line, _col, name, lineOffset) = - name <- null; - lineOffset <- 0; - NativeMethods.S_OK; - - // Generates proximity expressions, used to populate the "Autos" window - member fls.GetProximityExpressions(_buffer, _line, _col, _cLines, ppEnum) = - ppEnum <- null - NativeMethods.S_FALSE - - // Returns whether the location contains code that is mapped to another document, for example, client-side script code. - member fls.IsMappedLocation(_buffer, _line, _col) = - NativeMethods.S_FALSE - - // Disambiguates the given name, providing non-ambiguous names for all entities that "match" the name. - member fls.ResolveName(_name, _flags, ppNames) = - ppNames <- null - NativeMethods.E_NOTIMPL - - // Validates the given position as a place to set a breakpoint. - member fls.ValidateBreakpointLocation(buffer:IVsTextBuffer, line, col, pCodeSpan:TextSpan[]) = - let result = - if (pCodeSpan <> null) && (pCodeSpan.Length > 0) && (buffer :? IVsTextLines) then - let syncOk = - let view = fls.LastActiveTextView - view <> null && - let source = fls.GetSource(view) - source <> null && - ls.BackgroundRequests.TrySynchronizeParseFileInformation(view, source, millisecondsTimeout = 100) - let lineText = VsTextLines.LineText (buffer :?> IVsTextLines) line - let firstNonWhitespace = lineText.Length - (lineText.TrimStart [| ' '; '\t' |]).Length - let lastNonWhitespace = (lineText.TrimEnd [| ' '; '\t' |]).Length - // If the column is before the range of text then zap it to the text - // If the column is after the range of text then zap it to the _start_ of the text (like C#) - let attempt1, haveScope = - let col = if col > lastNonWhitespace || col < firstNonWhitespace then firstNonWhitespace else col - match ls.BackgroundRequests.ParseFileResults with - | Some parseResults -> - match parseResults.ValidateBreakpointLocation(Range.Pos.fromZ line col) with - | Some bpl -> Some (TextSpanOfRange bpl), true - | None -> None, true - | None -> - None, false - match attempt1 with - | Some r -> Some r - | None -> - if syncOk || haveScope then - None - else - // If we didn't sync OK AND we don't even have an ParseFileResults then just accept the whole line. - // This is unfortunate but necessary. - Some (TextSpan(iStartLine = line, iStartIndex = firstNonWhitespace, iEndLine = line, iEndIndex = lastNonWhitespace)) - else - None - - match result with - | Some span -> - pCodeSpan.[0] <- span - VSConstants.S_OK - | None -> - VSConstants.S_FALSE - - // ----------------------------------------------------------------------- - // Implement IVsProvideColorableItems - - interface IVsProvideColorableItems with - - member x.GetItemCount(count: int byref) = - count <- colorableItems.Length - VSConstants.S_OK - - member x.GetColorableItem(index, item: IVsColorableItem byref) = - if (index < 1) || (index > colorableItems.Length) then - VSConstants.E_INVALIDARG - else - item <- colorableItems.[index - 1] - VSConstants.S_OK - - /// Respond to changes to documents in the Running Document Table. - interface IVsRunningDocTableEvents with - member this.OnAfterAttributeChange(_docCookie, _grfAttribs) = VSConstants.S_OK - member this.OnAfterDocumentWindowHide(_docCookie, _frame) = VSConstants.S_OK - member this.OnAfterFirstDocumentLock(_docCookie,_dwRDTLockType,_dwReadLocks,_dwEditLocks) = VSConstants.S_OK - member this.OnAfterSave(_docCookie) = VSConstants.S_OK - member this.OnBeforeDocumentWindowShow(_docCookie,_isFirstShow,_frame) = VSConstants.S_OK - member this.OnBeforeLastDocumentUnlock(docCookie,_dwRDTLockType,dwReadLocksRemaining,dwEditLocksRemaining) = - let rdt = this.Site.RunningDocumentTable - let (_, _, _, _, file, _, _, unkdoc) = rdt.GetDocumentInfo docCookie // see here http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.ivsrunningdocumenttable.getdocumentinfo(VS.80).aspx for info on the `GetDocumentInfo` results we're ignoring - try - if int dwReadLocksRemaining = 0 && int dwEditLocksRemaining = 0 then // check that this is there are no other read / edit locks - if SourceFile.IsCompilable file then - if IntPtr.Zero<>unkdoc then - match Marshal.GetObjectForIUnknown(unkdoc) with - | :? IVsTextLines as tl -> - ls.ProjectSitesAndFiles.UnsetSource(tl) - | _ -> () - finally - if IntPtr.Zero <> unkdoc then Marshal.Release(unkdoc)|>ignore - VSConstants.S_OK - + /// ISettingsManager only implemented for VS 14.0+ + /// In case custom VS profile settings for F# are not applied, explicitly set them here. + /// e.g. 'keep tabs' is the text editor default, but F# requires 'insert spaces'. + /// We specify our customizations in the General profile for VS, but we have found that in some cases, + /// those customizations are incorrectly ignored. So we take action if the setting has no current custom value. + member private this.EstablishDefaultSettingsIfMissing() = + #if !VS_VERSION_DEV12 + + let fsharpSpecificProfileSettings = [| + "TextEditor.F#.Insert Tabs", box false + "TextEditor.F#.Brace Completion", box true + "TextEditor.F#.Make URLs Hot", box false + "TextEditor.F#.Indent Style", box 1u |] + + match this.GetService(typeof) with + | :? Microsoft.VisualStudio.Settings.ISettingsManager as settingsManager -> + for settingName,defaultValue in fsharpSpecificProfileSettings do + match settingsManager.TryGetValue(settingName) with + | Microsoft.VisualStudio.Settings.GetValueResult.Missing, _ -> + settingsManager.SetValueAsync(settingName, defaultValue, false) |> ignore + | _ -> () + | _ -> () + + #endif \ No newline at end of file diff --git a/vsintegration/src/FSharp.LanguageService/FSharpPackage.fs b/vsintegration/src/FSharp.LanguageService/FSharpPackage.fs deleted file mode 100644 index d5c5cca3566..00000000000 --- a/vsintegration/src/FSharp.LanguageService/FSharpPackage.fs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.VisualStudio.FSharp.LanguageService - -open System -open System.Configuration -open System.ComponentModel.Design -open System.Runtime.InteropServices -open Microsoft.VisualStudio -open Microsoft.VisualStudio.Shell -open Microsoft.VisualStudio.OLE.Interop - - -// Workaround to access non-public settings persistence type. -// GetService( ) with this will work as long as the GUID matches the real type. -[] -type internal SVsSettingsPersistenceManager = class end - -[] -type internal FSharpPackage() as self = - inherit Package() - - let mutable componentID = 0u - - let CreateIfEnabled container serviceType = - if LanguageServiceUtils.shouldEnableVSLanguageService then - self.CreateService(container,serviceType) - else - null - - let callback = new ServiceCreatorCallback(CreateIfEnabled) - - let mutable mgr : IOleComponentManager = null - -#if !VS_VERSION_DEV12 - let fsharpSpecificProfileSettings = - [| "TextEditor.F#.Insert Tabs", box false - "TextEditor.F#.Brace Completion", box true - "TextEditor.F#.Make URLs Hot", box false - "TextEditor.F#.Indent Style", box 1u |] -#endif - - override self.Initialize() = - UIThread.CaptureSynchronizationContext() - self.EstablishDefaultSettingsIfMissing() - (self :> IServiceContainer).AddService(typeof, callback, true) - base.Initialize() - - /// In case custom VS profile settings for F# are not applied, explicitly set them here. - /// e.g. 'keep tabs' is the text editor default, but F# requires 'insert spaces'. - /// We specify our customizations in the General profile for VS, but we have found that in some cases - /// those customizations are incorrectly ignored. - member private this.EstablishDefaultSettingsIfMissing() = -#if VS_VERSION_DEV12 - () // ISettingsManager only implemented for VS 14.0+ -#else - match this.GetService(typeof) with - | :? Microsoft.VisualStudio.Settings.ISettingsManager as settingsManager -> - for settingName,defaultValue in fsharpSpecificProfileSettings do - // Only take action if the setting has no current custom value - // If cloud-synced settings have already been applied or the user has made an explicit change, do nothing - match settingsManager.TryGetValue(settingName) with - | Microsoft.VisualStudio.Settings.GetValueResult.Missing, _ -> - settingsManager.SetValueAsync(settingName, defaultValue, false) |> ignore - | _ -> () - | _ -> () -#endif - - member self.RegisterForIdleTime() = - mgr <- (self.GetService(typeof) :?> IOleComponentManager) - if (componentID = 0u && mgr <> null) then - let crinfo = Array.zeroCreate(1) - let mutable crinfo0 = crinfo.[0] - crinfo0.cbSize <- Marshal.SizeOf(typeof) |> uint32 - crinfo0.grfcrf <- uint32 (_OLECRF.olecrfNeedIdleTime ||| _OLECRF.olecrfNeedPeriodicIdleTime) - crinfo0.grfcadvf <- uint32 (_OLECADVF.olecadvfModal ||| _OLECADVF.olecadvfRedrawOff ||| _OLECADVF.olecadvfWarningsOff) - crinfo0.uIdleTimeInterval <- 1000u - crinfo.[0] <- crinfo0 - let componentID_out = ref componentID - let _hr = mgr.FRegisterComponent(self, crinfo, componentID_out) - componentID <- componentID_out.Value - () - - member self.CreateService(_container:IServiceContainer, serviceType:Type) = - match serviceType with - | x when x = typeof -> - let language = new FSharpLanguageService() - language.SetSite(self) - language.Initialize() - self.RegisterForIdleTime() - box language - | _ -> null - - override self.Dispose(disposing) = - try - if (componentID <> 0u) then - begin match self.GetService(typeof) with - | :? IOleComponentManager as mgr -> - mgr.FRevokeComponent(componentID) |> ignore - | _ -> () - end - componentID <- 0u - finally - base.Dispose(disposing) - - interface IOleComponent with - - override x.FContinueMessageLoop(_uReason:uint32, _pvLoopData:IntPtr, _pMsgPeeked:MSG[]) = - 1 - - override x.FDoIdle(grfidlef:uint32) = - // see e.g "C:\Program Files\Microsoft Visual Studio 2008 SDK\VisualStudioIntegration\Common\IDL\olecm.idl" for details - //Trace.Print("CurrentDirectoryDebug", (fun () -> sprintf "curdir='%s'\n" (System.IO.Directory.GetCurrentDirectory()))) // can be useful for watching how GetCurrentDirectory changes - match x.GetService(typeof) with - | :? FSharpLanguageService as pl -> - let periodic = (grfidlef &&& (uint32 _OLEIDLEF.oleidlefPeriodic)) <> 0u - let mutable r = pl.OnIdle(periodic, mgr) - if r = 0 && periodic && mgr.FContinueIdle() <> 0 then - r <- TaskReporterIdleRegistration.DoIdle(mgr) - r - | _ -> 0 - - override x.FPreTranslateMessage(_pMsg) = 0 - - override x.FQueryTerminate(_fPromptUser) = 1 - - override x.FReserved1(_dwReserved, _message, _wParam, _lParam) = 1 - - override x.HwndGetWindow(_dwWhich, _dwReserved) = 0n - - override x.OnActivationChange(_pic, _fSameComponent, _pcrinfo, _fHostIsActivating, _pchostinfo, _dwReserved) = () - - override x.OnAppActivate(_fActive, _dwOtherThreadID) = () - - override x.OnEnterState(_uStateID, _fEnter) = () - - override x.OnLoseActivation() = () - - override x.Terminate() = () - - diff --git a/vsintegration/src/FSharp.LanguageService/FSRoslynProject.fs b/vsintegration/src/FSharp.LanguageService/FSharpProjectSite.fs similarity index 87% rename from vsintegration/src/FSharp.LanguageService/FSRoslynProject.fs rename to vsintegration/src/FSharp.LanguageService/FSharpProjectSite.fs index 2e66afc4aae..f78f627457b 100644 --- a/vsintegration/src/FSharp.LanguageService/FSRoslynProject.fs +++ b/vsintegration/src/FSharp.LanguageService/FSharpProjectSite.fs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. namespace Microsoft.VisualStudio.FSharp.LanguageService @@ -19,7 +19,7 @@ open Microsoft.CodeAnalysis open Microsoft.VisualStudio.LanguageServices.Implementation open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem -type FSRoslynProject(hierarchy: IVsHierarchy, serviceProvider: System.IServiceProvider, visualStudioWorkspace: VisualStudioWorkspaceImpl, projectName: string) = +type FSharpProjectSite(hierarchy: IVsHierarchy, serviceProvider: System.IServiceProvider, visualStudioWorkspace: VisualStudioWorkspaceImpl, projectName: string) = inherit AbstractProject(visualStudioWorkspace.ProjectTracker, null, projectName, hierarchy, "F#", serviceProvider, null, visualStudioWorkspace, null) let mutable checkOptions : FSharpProjectOptions option = None @@ -32,10 +32,10 @@ type FSRoslynProject(hierarchy: IVsHierarchy, serviceProvider: System.IServicePr member internal this.Initialize(hier: IVsHierarchy, site : IProjectSite) = this.ProjectTracker.AddProject(this) - site.AdviseProjectSiteChanges(KnownAdviseProjectSiteChangesCallbackOwners.LanguageService, + site.AdviseProjectSiteChanges(FSharpCommonConstants.FSharpLanguageServiceCallbackName, new AdviseProjectSiteChanges(fun () -> this.OnProjectSettingsChanged(hier, site))) - site.AdviseProjectSiteClosed(KnownAdviseProjectSiteChangesCallbackOwners.LanguageService, + site.AdviseProjectSiteClosed(FSharpCommonConstants.FSharpLanguageServiceCallbackName, new AdviseProjectSiteChanges(fun () -> this.Disconnect())) // Add files and references. @@ -95,4 +95,4 @@ type FSRoslynProject(hierarchy: IVsHierarchy, serviceProvider: System.IServicePr Seq.iter(fun ref -> this.RemoveReference(ref.FilePath)) // If the order of files changed, that'll be captured in the checkOptions. - checkOptions <- Some(ProjectSitesAndFiles.GetProjectOptionsForProjectSite(site, site.ProjectFileName())) + checkOptions <- Some(ProjectSitesAndFiles.GetProjectOptionsForProjectSite(site, site.ProjectFileName())) \ No newline at end of file diff --git a/vsintegration/src/FSharp.LanguageService/LanguageServiceUtils.fs b/vsintegration/src/FSharp.LanguageService/LanguageServiceUtils.fs index c5cfd34e74a..dbaa0c6d5f4 100644 --- a/vsintegration/src/FSharp.LanguageService/LanguageServiceUtils.fs +++ b/vsintegration/src/FSharp.LanguageService/LanguageServiceUtils.fs @@ -6,7 +6,7 @@ open System open System.Configuration open System.Diagnostics -module FSRoslynCommonConstants = +module FSharpCommonConstants = [] let packageGuid = "871D2A70-12A2-4e42-9440-425DD92A4116" [] @@ -16,27 +16,23 @@ module FSRoslynCommonConstants = [] let FSharpLanguageName = "F#" [] - let FSharpContentType = "F#" + let FSharpContentTypeName = "F#" + [] + let FSharpLanguageServiceCallbackName = "F# Language Service" module LanguageServiceUtils = - // This key can have 'off', 'vs', and 'roslyn' states. Will default to 'vs'. - let private languageServiceTypeKey = "fsharp-language-service" + // This key can have 'true' and 'false' values. Will default to 'true'. + let private shouldEnableLanguageServiceKey = "enable-fsharp-language-service" let private getConfigValue(key: string) = try - ConfigurationManager.AppSettings.[key].ToLower() + ConfigurationManager.AppSettings.[key] with ex -> Debug.Assert(false, sprintf "Error loading 'devenv.exe.config' configuration[%s]: %A" key ex) String.Empty - let shouldEnableVSLanguageService = - match getConfigValue(languageServiceTypeKey) with - | "off" -> false - | "roslyn" -> false + let shouldEnableLanguageService = + match getConfigValue(shouldEnableLanguageServiceKey).ToLower() with + | "false" -> false | _ -> true - - let shouldEnableRoslynLanguageService = - match getConfigValue(languageServiceTypeKey) with - | "roslyn" -> true - | _ -> false diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs b/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs index b403d93d457..7b5e834d621 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs @@ -751,7 +751,7 @@ See also ...\SetupAuthoring\FSharp\Registry\FSProjSys_Registration.wxs, e.g. override x.GetGuidProperty(propid:int, guid:byref ) = if (enum propid = __VSHPROPID.VSHPROPID_PreferredLanguageSID) then - guid <- new Guid(FSharpCommonConstants.languageServiceGuidString) + guid <- new Guid(FSharpCommonConstants.languageServiceGuid) VSConstants.S_OK // below is how VS decide 'which templates' to associate with an 'add new item' call in this project elif (enum propid = __VSHPROPID2.VSHPROPID_AddItemTemplatesGuid) then From 0172d9cdc4d632d30ed6f14f10a738b3279be3b8 Mon Sep 17 00:00:00 2001 From: Omar Tawfik Date: Thu, 18 Feb 2016 15:32:50 -0800 Subject: [PATCH 10/13] Fix test breaks --- .../FSharpLanguageService.fs | 25 +- .../FSharpProjectSite.fs | 2 +- .../LanguageServiceUtils.fs | 8 +- .../Salsa/FSharpLanguageServiceTestable.fs | 223 ++++++++++++++++++ .../tests/Salsa/VisualFSharp.Salsa.fsproj | 2 + 5 files changed, 249 insertions(+), 11 deletions(-) create mode 100644 vsintegration/tests/Salsa/FSharpLanguageServiceTestable.fs diff --git a/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs b/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs index 0d944b7ce1a..ece8b1dcd83 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs +++ b/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs @@ -14,17 +14,18 @@ open Microsoft.VisualStudio open Microsoft.VisualStudio.LanguageServices open Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem +open Microsoft.VisualStudio.LanguageServices.Implementation.DebuggerIntelliSense open Microsoft.VisualStudio.LanguageServices.Implementation open Microsoft.VisualStudio.Shell open Microsoft.VisualStudio.Shell.Interop // Workaround to access non-public settings persistence type. // GetService( ) with this will work as long as the GUID matches the real type. -[] +[] type internal SVsSettingsPersistenceManager = class end [] -type FSharpLanguageService(package : FSharpPackage) = +type internal FSharpLanguageService(package : FSharpPackage) = inherit AbstractLanguageService(package) override this.ContentTypeName = FSharpCommonConstants.FSharpContentTypeName @@ -59,14 +60,18 @@ type FSharpLanguageService(package : FSharpPackage) = | _ -> () and [] - FSharpEditorFactory(package : FSharpPackage) = + internal FSharpEditorFactory(package : FSharpPackage) = inherit AbstractEditorFactory(package) override this.ContentTypeName = FSharpCommonConstants.FSharpContentTypeName override this.GetFormattedTextChanges(_, _, _, _) = System.Collections.Generic.List() :> System.Collections.Generic.IList + +and [] + internal FSharpCodePageEditorFactory(editorFactory: FSharpEditorFactory) = + inherit AbstractCodePageEditorFactory(editorFactory) and [] - FSharpPackage() = + internal FSharpPackage() = inherit AbstractPackage() override this.RoslynLanguageName = FSharpCommonConstants.FSharpLanguageName @@ -77,12 +82,16 @@ and [] override this.CreateWorkspace() = this.ComponentModel.GetService() - override this.CreateLanguageService() = - let language = new FSharpLanguageService(this) - language + override this.CreateLanguageService() = new FSharpLanguageService(this) override this.CreateEditorFactories() = - [] :> IEnumerable + let editorFactory = new FSharpEditorFactory(this) + let codePageEditorFactory = new FSharpCodePageEditorFactory(editorFactory) + + [| + editorFactory :> IVsEditorFactory; + codePageEditorFactory :> IVsEditorFactory; + |] :> IEnumerable override this.RegisterMiscellaneousFilesWorkspaceInformation(_) = () diff --git a/vsintegration/src/FSharp.LanguageService/FSharpProjectSite.fs b/vsintegration/src/FSharp.LanguageService/FSharpProjectSite.fs index f78f627457b..5368b33d5df 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharpProjectSite.fs +++ b/vsintegration/src/FSharp.LanguageService/FSharpProjectSite.fs @@ -19,7 +19,7 @@ open Microsoft.CodeAnalysis open Microsoft.VisualStudio.LanguageServices.Implementation open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem -type FSharpProjectSite(hierarchy: IVsHierarchy, serviceProvider: System.IServiceProvider, visualStudioWorkspace: VisualStudioWorkspaceImpl, projectName: string) = +type internal FSharpProjectSite(hierarchy: IVsHierarchy, serviceProvider: System.IServiceProvider, visualStudioWorkspace: VisualStudioWorkspaceImpl, projectName: string) = inherit AbstractProject(visualStudioWorkspace.ProjectTracker, null, projectName, hierarchy, "F#", serviceProvider, null, visualStudioWorkspace, null) let mutable checkOptions : FSharpProjectOptions option = None diff --git a/vsintegration/src/FSharp.LanguageService/LanguageServiceUtils.fs b/vsintegration/src/FSharp.LanguageService/LanguageServiceUtils.fs index dbaa0c6d5f4..46d0c673224 100644 --- a/vsintegration/src/FSharp.LanguageService/LanguageServiceUtils.fs +++ b/vsintegration/src/FSharp.LanguageService/LanguageServiceUtils.fs @@ -6,7 +6,7 @@ open System open System.Configuration open System.Diagnostics -module FSharpCommonConstants = +module internal FSharpCommonConstants = [] let packageGuid = "871D2A70-12A2-4e42-9440-425DD92A4116" [] @@ -14,13 +14,17 @@ module FSharpCommonConstants = [] let editorFactoryGuid = "4EB7CCB7-4336-4FFD-B12B-396E9FD079A9" [] + let codePageEditorFactoryGuid = "82A16493-EF43-47E0-B42D-D87BAAB5335D" + [] + let svsSettingsPersistenceManagerGuid = "9B164E40-C3A2-4363-9BC5-EB4039DEF653" + [] let FSharpLanguageName = "F#" [] let FSharpContentTypeName = "F#" [] let FSharpLanguageServiceCallbackName = "F# Language Service" -module LanguageServiceUtils = +module internal LanguageServiceUtils = // This key can have 'true' and 'false' values. Will default to 'true'. let private shouldEnableLanguageServiceKey = "enable-fsharp-language-service" diff --git a/vsintegration/tests/Salsa/FSharpLanguageServiceTestable.fs b/vsintegration/tests/Salsa/FSharpLanguageServiceTestable.fs new file mode 100644 index 00000000000..5d6fe745bac --- /dev/null +++ b/vsintegration/tests/Salsa/FSharpLanguageServiceTestable.fs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Salsa + +open System +open System.IO +open System.Collections.Generic +open System.Configuration +open System.Globalization +open System.Runtime.InteropServices +open Microsoft.VisualStudio +open Microsoft.VisualStudio.Shell +open Microsoft.VisualStudio.Shell.Interop +open Microsoft.VisualStudio.TextManager.Interop +open Microsoft.VisualStudio.Text +open Microsoft.VisualStudio.OLE.Interop +open Microsoft.FSharp.Compiler +open Microsoft.FSharp.Compiler.SourceCodeServices +open Microsoft.VisualStudio.FSharp.LanguageService + +type internal FSharpLanguageServiceTestable() as this = + static let colorizerGuid = new Guid("{A2976312-7D71-4BB4-A5F8-66A08EBF46C8}") // Guid for colorized user data on IVsTextBuffer + let mutable checkerContainerOpt : FSharpChecker option = None + let mutable artifacts : ProjectSitesAndFiles option = None + let mutable serviceProvider : System.IServiceProvider option = None + let mutable preferences : LanguagePreferences option = None + let mutable documentationBuilder : IDocumentationBuilder option = None + let mutable sourceFactory : (IVsTextLines -> IFSharpSource) option = None + let mutable dirtyForTypeCheckFiles : Set = Set.empty + let mutable isInitialized = false + let mutable unhooked = false + let getColorizer (view:IVsTextView) = + let buffer = Com.ThrowOnFailure1(view.GetBuffer()) + this.GetColorizer(buffer) + + let bgRequests = new FSharpLanguageServiceBackgroundRequests(getColorizer,(fun () -> this.FSharpChecker),(fun () -> this.ProjectSitesAndFiles),(fun () -> this.ServiceProvider),(fun () -> this.DocumentationBuilder)) + + member this.FSharpChecker = + if this.Unhooked then raise Error.UseOfUnhookedLanguageServiceState + if not this.IsInitialized then raise Error.UseOfUninitializedLanguageServiceState + checkerContainerOpt.Value + + member this.ServiceProvider = + if this.Unhooked then raise Error.UseOfUnhookedLanguageServiceState + if not this.IsInitialized then raise Error.UseOfUninitializedLanguageServiceState + serviceProvider.Value + + member this.ProjectSitesAndFiles = + if not this.IsInitialized then raise Error.UseOfUninitializedLanguageServiceState + artifacts.Value + + member this.Preferences = + if this.Unhooked then raise Error.UseOfUnhookedLanguageServiceState + if not this.IsInitialized then raise Error.UseOfUninitializedLanguageServiceState + preferences.Value + + member this.SourceFactory = + if this.Unhooked then raise Error.UseOfUnhookedLanguageServiceState + if not this.IsInitialized then raise Error.UseOfUninitializedLanguageServiceState + sourceFactory.Value + + member this.IsInitialized = isInitialized + member this.Unhooked = unhooked + member this.DocumentationBuilder = documentationBuilder.Value + + /// Handle late intialization pieces + member this.Initialize (sp, dp, prefs, sourceFact) = + if this.Unhooked then raise Error.UseOfUnhookedLanguageServiceState + artifacts <- Some (ProjectSitesAndFiles()) + let checker = FSharpChecker.Create() + checker.BeforeBackgroundFileCheck.Add (fun filename -> UIThread.Run(fun () -> this.NotifyFileTypeCheckStateIsDirty(filename))) + checkerContainerOpt <- Some (checker) + serviceProvider <- Some sp + isInitialized <- true + unhooked <- false + documentationBuilder <- Some dp + preferences <- Some prefs + sourceFactory <- Some sourceFact + + + member this.NotifyFileTypeCheckStateIsDirty(filename) = + dirtyForTypeCheckFiles <- dirtyForTypeCheckFiles.Add filename + + /// Clear all language service caches and finalize all transient references to compiler objects + member this.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() = + if this.Unhooked then raise Error.UseOfUnhookedLanguageServiceState + if this.IsInitialized then + this.FSharpChecker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() + + /// Unhook the object. These are the held resources that need to be disposed. + member this.Unhook() = + if this.Unhooked then raise Error.UseOfUnhookedLanguageServiceState + if this.IsInitialized then + // Dispose the preferences. + if this.Preferences <> null then this.Preferences.Dispose() + // Stop the background compile. + // here we refer to checkerContainerOpt directly to avoid triggering its creation + match checkerContainerOpt with + | Some container -> + let checker = container + checker.StopBackgroundCompile() + checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() + | None -> () + + checkerContainerOpt <- None + artifacts <- None + preferences <- None + documentationBuilder <- None + unhooked <- true + sourceFactory <- None + serviceProvider <- None + + /// Respond to project settings changes + member this.OnProjectSettingsChanged(site:IProjectSite) = + // The project may have changed its references. These would be represented as 'dependency files' of each source file. Each source file will eventually start listening + // for changes to those dependencies, at which point we'll get OnDependencyFileCreateOrDelete notifications. Until then, though, we just 'make a note' that this project is out of date. + bgRequests.AddOutOfDateProjectFileName(site.ProjectFileName()) + for filename in site.SourceFilesOnDisk() do + let rdt = this.ServiceProvider.RunningDocumentTable + match this.ProjectSitesAndFiles.TryGetSourceOfFile(rdt,filename) with + | Some source -> + source.RecolorizeWholeFile() + source.RecordChangeToView() + | None -> () + + /// Respond to project being cleaned/rebuilt (any live type providers in the project should be refreshed) + member this.OnProjectCleaned(projectSite:IProjectSite) = + let checkOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(projectSite, "") + this.FSharpChecker.NotifyProjectCleaned(checkOptions) + + member this.OnActiveViewChanged(textView) = + bgRequests.OnActiveViewChanged(textView) + + member this.BackgroundRequests = bgRequests + + /// Unittestable complement to LanguageServce.CreateSource + member this.CreateSource(buffer:IVsTextLines) : IFSharpSource = + + // Each time a source is created, also verify that the IProjectSite has been initialized to listen to changes to the project. + // We can't listen to OnProjectLoaded because the language service is not guaranteed to be loaded when this is called. + let filename = VsTextLines.GetFilename buffer + let rdt = this.ServiceProvider.RunningDocumentTable + let result = VsRunningDocumentTable.FindDocumentWithoutLocking(rdt,filename) + match result with + | Some(hier,_) -> + match hier with + | :? IProvideProjectSite as siteProvider -> + let site = siteProvider.GetProjectSite() + site.AdviseProjectSiteChanges(FSharpCommonConstants.FSharpLanguageServiceCallbackName, + new AdviseProjectSiteChanges(fun () -> this.OnProjectSettingsChanged(site))) + site.AdviseProjectSiteCleaned(FSharpCommonConstants.FSharpLanguageServiceCallbackName, + new AdviseProjectSiteChanges(fun () -> this.OnProjectCleaned(site))) + | _ -> + // This can happen when the file is in a solution folder or in, say, a C# project. + () + | _ -> + // This can happen when renaming a file from a different language service into .fs or fsx. + // This naturally won't have an associated project. + () + + // Create the source and register file change callbacks there. + let source = this.SourceFactory(buffer) + this.ProjectSitesAndFiles.SetSource(buffer, source) + source + + // For each change in dependency files, notify the language service of the change and propagate the update + interface IDependencyFileChangeNotify with + member this.DependencyFileCreated projectSite = + // Invalidate the configuration if we notice any add for any DependencyFiles + let checkOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(projectSite, "") + this.FSharpChecker.InvalidateConfiguration(checkOptions) + + member this.DependencyFileChanged (filename) = + this.NotifyFileTypeCheckStateIsDirty filename + + + /// Do OnIdle processing for the whole language service. dirtyForTypeCheckFiles can be set by events + /// raised on the background compilation thread. + member this.OnIdle() = + for file in dirtyForTypeCheckFiles do + let rdt = this.ServiceProvider.RunningDocumentTable + match this.ProjectSitesAndFiles.TryGetSourceOfFile(rdt, file) with + | Some source -> source.RecordChangeToView() + | None -> () + dirtyForTypeCheckFiles <- Set.empty + + + /// Remove a colorizer. + member this.CloseColorizer(colorizer:FSharpColorizer) = + let buffer = colorizer.Buffer + let mutable guid = colorizerGuid + (buffer :?> IVsUserData).SetData(&guid, null) |> ErrorHandler.ThrowOnFailure |> ignore + + /// Get a colorizer for a particular buffer. + member this.GetColorizer(buffer:IVsTextLines) : FSharpColorizer = + let mutable guid = colorizerGuid + let mutable colorizerObj = null + + (buffer :?> IVsUserData).GetData(&guid, &colorizerObj) |> ignore + match colorizerObj with + | null -> + let scanner = + new FSharpScanner(fun source -> + // Note: in theory, the next few lines do not need to be recomputed every line. Instead we could just cache the tokenizer + // and only update it when e.g. the project system notifies us there is an important change (e.g. a file rename, etc). + // In practice we have been there, and always screwed up some non-unit-tested/testable corner-cases. + // So this is not ideal from a perf perspective, but it is easy to reason about the correctness. + let filename = VsTextLines.GetFilename buffer + let rdt = this.ServiceProvider.RunningDocumentTable + let defines = this.ProjectSitesAndFiles.GetDefinesForFile(rdt, filename) + let sourceTokenizer = FSharpSourceTokenizer(defines,filename) + sourceTokenizer.CreateLineTokenizer(source)) + + let colorizer = new FSharpColorizer(this.CloseColorizer, buffer, scanner) + (buffer :?> IVsUserData).SetData(&guid, colorizer) |> ErrorHandler.ThrowOnFailure |> ignore + colorizer + | _ -> colorizerObj :?> FSharpColorizer + + /// Block until the background compile finishes. + // + // This is for unit testing only + member this.WaitForBackgroundCompile() = + this.FSharpChecker.WaitForBackgroundCompile() \ No newline at end of file diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index 70be31ae40c..32e441c2b39 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -27,6 +27,7 @@ UnitTests.TestLib.Utils.fs + @@ -41,6 +42,7 @@ + From 08be5d62a4e639b236d9bd685ee3ebf76e9639a6 Mon Sep 17 00:00:00 2001 From: Omar Tawfik Date: Thu, 18 Feb 2016 15:53:13 -0800 Subject: [PATCH 11/13] Update Roslyn packages to 1.2.0-beta1-20160218-02 --- packages.config | 12 ++++++------ src/FSharpSource.targets | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages.config b/packages.config index a80d26b9ace..b507dc8c264 100644 --- a/packages.config +++ b/packages.config @@ -6,10 +6,10 @@ - - - - - - + + + + + + \ No newline at end of file diff --git a/src/FSharpSource.targets b/src/FSharpSource.targets index cb7fbf53eeb..709c33924ef 100644 --- a/src/FSharpSource.targets +++ b/src/FSharpSource.targets @@ -114,7 +114,7 @@ $(FSharpSourcesRoot)\..\packages\FsCheck.$(FsCheckVersion)\lib\ 1.0.30 1.1.37 - 1.2.0-beta1-20160215-01 + 1.2.0-beta1-20160218-02 From b3724dbfa9e2f7f4c7980dc08f124b7fc4b6759b Mon Sep 17 00:00:00 2001 From: Omar Tawfik Date: Fri, 19 Feb 2016 12:01:13 -0800 Subject: [PATCH 12/13] Disabling editor factories until fully implemented --- .../FSharp.LanguageService.fsproj | 2 +- ...ServiceUtils.fs => FSharpCommonConstants.fs} | 17 ----------------- .../FSharpLanguageService.fs | 10 ++++++---- 3 files changed, 7 insertions(+), 22 deletions(-) rename vsintegration/src/FSharp.LanguageService/{LanguageServiceUtils.fs => FSharpCommonConstants.fs} (60%) diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index 8bb56099eb4..e0b5e612e84 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -26,7 +26,7 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService/LanguageServiceUtils.fs b/vsintegration/src/FSharp.LanguageService/FSharpCommonConstants.fs similarity index 60% rename from vsintegration/src/FSharp.LanguageService/LanguageServiceUtils.fs rename to vsintegration/src/FSharp.LanguageService/FSharpCommonConstants.fs index 46d0c673224..4e77c7a6b1f 100644 --- a/vsintegration/src/FSharp.LanguageService/LanguageServiceUtils.fs +++ b/vsintegration/src/FSharp.LanguageService/FSharpCommonConstants.fs @@ -23,20 +23,3 @@ module internal FSharpCommonConstants = let FSharpContentTypeName = "F#" [] let FSharpLanguageServiceCallbackName = "F# Language Service" - -module internal LanguageServiceUtils = - - // This key can have 'true' and 'false' values. Will default to 'true'. - let private shouldEnableLanguageServiceKey = "enable-fsharp-language-service" - - let private getConfigValue(key: string) = - try - ConfigurationManager.AppSettings.[key] - with ex -> - Debug.Assert(false, sprintf "Error loading 'devenv.exe.config' configuration[%s]: %A" key ex) - String.Empty - - let shouldEnableLanguageService = - match getConfigValue(shouldEnableLanguageServiceKey).ToLower() with - | "false" -> false - | _ -> true diff --git a/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs b/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs index ece8b1dcd83..ed191b6b973 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs +++ b/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs @@ -85,12 +85,14 @@ and [] override this.CreateLanguageService() = new FSharpLanguageService(this) override this.CreateEditorFactories() = - let editorFactory = new FSharpEditorFactory(this) - let codePageEditorFactory = new FSharpCodePageEditorFactory(editorFactory) + // Disabling editor factories until fully implemented + + // let editorFactory = new FSharpEditorFactory(this) + // let codePageEditorFactory = new FSharpCodePageEditorFactory(editorFactory) [| - editorFactory :> IVsEditorFactory; - codePageEditorFactory :> IVsEditorFactory; + // editorFactory :> IVsEditorFactory; + // codePageEditorFactory :> IVsEditorFactory; |] :> IEnumerable override this.RegisterMiscellaneousFilesWorkspaceInformation(_) = () From c6cebf849e1ee01c7b98ac7a800fe5d7a93f6382 Mon Sep 17 00:00:00 2001 From: Omar Tawfik Date: Fri, 19 Feb 2016 13:12:44 -0800 Subject: [PATCH 13/13] Addressing code review comments --- .../src/FSharp.Editor/BraceCompletion.fs | 2 +- .../FSharp.Editor/FSharpProjectSiteService.fs | 2 +- .../src/FSharp.Editor/SmartIndent.fs | 2 +- .../src/FSharp.Editor/extension.vsixmanifest | 4 +- .../FSharpCommonConstants.fs | 10 ++--- .../FSharpLanguageService.fs | 23 +++++----- .../FSharpProjectSite.fs | 43 ++++++------------- .../FSharp.ProjectSystem.FSharp/Project.fs | 2 +- 8 files changed, 36 insertions(+), 52 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/BraceCompletion.fs b/vsintegration/src/FSharp.Editor/BraceCompletion.fs index 87acf7a3094..4dff3674067 100644 --- a/vsintegration/src/FSharp.Editor/BraceCompletion.fs +++ b/vsintegration/src/FSharp.Editor/BraceCompletion.fs @@ -24,7 +24,7 @@ type internal CompletionContext(tokenContext : TokenContext, textManager : IVsTe /// Called when user hits Return while inside of a brace completion session. member this.OnReturn(session) = - let lp = [| LANGPREFERENCES(guidLang = Guid(FSharpCommonConstants.languageServiceGuid)) |] + let lp = [| LANGPREFERENCES(guidLang = Guid(FSharpCommonConstants.languageServiceGuidString)) |] ErrorHandler.ThrowOnFailure(textManager.GetUserPreferences(null, null, lp, null)) |> ignore // if smart indent is not enabled, or we are in a string, don't do any special formatting diff --git a/vsintegration/src/FSharp.Editor/FSharpProjectSiteService.fs b/vsintegration/src/FSharp.Editor/FSharpProjectSiteService.fs index 7804d1c12cf..acd1e712205 100644 --- a/vsintegration/src/FSharp.Editor/FSharpProjectSiteService.fs +++ b/vsintegration/src/FSharp.Editor/FSharpProjectSiteService.fs @@ -11,7 +11,7 @@ open Microsoft.CodeAnalysis.Host.Mef open Microsoft.VisualStudio.FSharp.LanguageService open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem -// Currently the CompilationOptions type in Roslyn in sealed and there's no way to set the compilation options for a project. +// Currently the CompilationOptions type in Roslyn is sealed and there's no way to set the compilation options for a project. // There's no property bag on a project either. So this service is a means to get the host project for a given Roslyn project // so that extra F# specific information can be stored on the host project. // Note that the FSharpProject is available only through the VS Workspace although we might call this service from projects of diff --git a/vsintegration/src/FSharp.Editor/SmartIndent.fs b/vsintegration/src/FSharp.Editor/SmartIndent.fs index 018fbd09024..1c9b1636fe2 100644 --- a/vsintegration/src/FSharp.Editor/SmartIndent.fs +++ b/vsintegration/src/FSharp.Editor/SmartIndent.fs @@ -49,7 +49,7 @@ type SmartIndent (textView : ITextView, textManager : IVsTextManager) = /// or null when no indentation is desired or unable to determine indentation member this.GetDesiredIndentation(line : ITextSnapshotLine) = - let lp = [| LANGPREFERENCES(guidLang = Guid(FSharpCommonConstants.languageServiceGuid)) |] + let lp = [| LANGPREFERENCES(guidLang = Guid(FSharpCommonConstants.languageServiceGuidString)) |] let indentStyle = if ErrorHandler.Succeeded(textManager.GetUserPreferences(null, null, lp, null)) then lp.[0].IndentStyle else vsIndentStyle.vsIndentStyleDefault if (indentStyle = vsIndentStyle.vsIndentStyleNone || _textView = null || _textView.IsClosed) then diff --git a/vsintegration/src/FSharp.Editor/extension.vsixmanifest b/vsintegration/src/FSharp.Editor/extension.vsixmanifest index 2942212b682..a38c05d0066 100644 --- a/vsintegration/src/FSharp.Editor/extension.vsixmanifest +++ b/vsintegration/src/FSharp.Editor/extension.vsixmanifest @@ -1,5 +1,5 @@ - + @@ -14,7 +14,7 @@ true - + diff --git a/vsintegration/src/FSharp.LanguageService/FSharpCommonConstants.fs b/vsintegration/src/FSharp.LanguageService/FSharpCommonConstants.fs index 4e77c7a6b1f..b1133e186eb 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharpCommonConstants.fs +++ b/vsintegration/src/FSharp.LanguageService/FSharpCommonConstants.fs @@ -8,15 +8,15 @@ open System.Diagnostics module internal FSharpCommonConstants = [] - let packageGuid = "871D2A70-12A2-4e42-9440-425DD92A4116" + let packageGuidString = "871D2A70-12A2-4e42-9440-425DD92A4116" [] - let languageServiceGuid = "BC6DD5A5-D4D6-4dab-A00D-A51242DBAF1B" + let languageServiceGuidString = "BC6DD5A5-D4D6-4dab-A00D-A51242DBAF1B" [] - let editorFactoryGuid = "4EB7CCB7-4336-4FFD-B12B-396E9FD079A9" + let editorFactoryGuidString = "4EB7CCB7-4336-4FFD-B12B-396E9FD079A9" [] - let codePageEditorFactoryGuid = "82A16493-EF43-47E0-B42D-D87BAAB5335D" + let codePageEditorFactoryGuidString = "82A16493-EF43-47E0-B42D-D87BAAB5335D" [] - let svsSettingsPersistenceManagerGuid = "9B164E40-C3A2-4363-9BC5-EB4039DEF653" + let svsSettingsPersistenceManagerGuidString = "9B164E40-C3A2-4363-9BC5-EB4039DEF653" [] let FSharpLanguageName = "F#" [] diff --git a/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs b/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs index ed191b6b973..ec6522776fc 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs +++ b/vsintegration/src/FSharp.LanguageService/FSharpLanguageService.fs @@ -9,7 +9,6 @@ open System.Runtime.InteropServices open Microsoft.FSharp.Compiler.SourceCodeServices open Microsoft.CodeAnalysis -open Microsoft.CodeAnalysis.SolutionCrawler open Microsoft.VisualStudio open Microsoft.VisualStudio.LanguageServices open Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService @@ -21,10 +20,10 @@ open Microsoft.VisualStudio.Shell.Interop // Workaround to access non-public settings persistence type. // GetService( ) with this will work as long as the GUID matches the real type. -[] +[] type internal SVsSettingsPersistenceManager = class end -[] +[] type internal FSharpLanguageService(package : FSharpPackage) = inherit AbstractLanguageService(package) @@ -32,7 +31,7 @@ type internal FSharpLanguageService(package : FSharpPackage) = override this.LanguageName = FSharpCommonConstants.FSharpLanguageName override this.RoslynLanguageName = FSharpCommonConstants.FSharpLanguageName - override this.LanguageServiceId = new Guid(FSharpCommonConstants.languageServiceGuid) + override this.LanguageServiceId = new Guid(FSharpCommonConstants.languageServiceGuidString) override this.DebuggerLanguageId = DebuggerEnvironment.GetLanguageID() override this.CreateContext(_,_,_,_,_) = raise(System.NotImplementedException()) @@ -51,26 +50,26 @@ type internal FSharpLanguageService(package : FSharpPackage) = match hier with | :? IProvideProjectSite as siteProvider -> let site = siteProvider.GetProjectSite() - - let projectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(site.ProjectFileName(), site.ProjectFileName()) + let projectFileName = site.ProjectFileName() + let projectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(projectFileName, projectFileName) if obj.ReferenceEquals(workspace.ProjectTracker.GetProject(projectId), null) then - let projectSite = new FSharpProjectSite(hier, this.SystemServiceProvider, workspace, site.ProjectFileName()); + let projectSite = new FSharpProjectSite(hier, this.SystemServiceProvider, workspace, projectFileName); projectSite.Initialize(hier, site) | _ -> () | _ -> () -and [] +and [] internal FSharpEditorFactory(package : FSharpPackage) = inherit AbstractEditorFactory(package) override this.ContentTypeName = FSharpCommonConstants.FSharpContentTypeName - override this.GetFormattedTextChanges(_, _, _, _) = System.Collections.Generic.List() :> System.Collections.Generic.IList + override this.GetFormattedTextChanges(_, _, _, _) = upcast Array.empty -and [] +and [] internal FSharpCodePageEditorFactory(editorFactory: FSharpEditorFactory) = inherit AbstractCodePageEditorFactory(editorFactory) -and [] +and [] internal FSharpPackage() = inherit AbstractPackage() @@ -93,7 +92,7 @@ and [] [| // editorFactory :> IVsEditorFactory; // codePageEditorFactory :> IVsEditorFactory; - |] :> IEnumerable + |] :> seq override this.RegisterMiscellaneousFilesWorkspaceInformation(_) = () diff --git a/vsintegration/src/FSharp.LanguageService/FSharpProjectSite.fs b/vsintegration/src/FSharp.LanguageService/FSharpProjectSite.fs index 5368b33d5df..ff4c87ee762 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharpProjectSite.fs +++ b/vsintegration/src/FSharp.LanguageService/FSharpProjectSite.fs @@ -38,28 +38,18 @@ type internal FSharpProjectSite(hierarchy: IVsHierarchy, serviceProvider: System site.AdviseProjectSiteClosed(FSharpCommonConstants.FSharpLanguageServiceCallbackName, new AdviseProjectSiteChanges(fun () -> this.Disconnect())) - // Add files and references. - site.SourceFilesOnDisk() |> - Seq.iter(fun file -> this.AddDocument(hier, file)) - - this.GetReferences(site.CompilerFlags()) |> - Seq.iter(fun ref -> this.AddReference(ref) |> ignore) + // Add files and references + for file in site.SourceFilesOnDisk() do this.AddDocument(hier, file) + for ref in this.GetReferences(site.CompilerFlags()) do this.AddReference(ref) // Capture the F# specific options that we'll pass to the type checker. checkOptions <- Some(ProjectSitesAndFiles.GetProjectOptionsForProjectSite(site, site.ProjectFileName())) member this.GetReferences(flags : string[]) = - let (|Reference|_|) (f : string) = if f.StartsWith("-r:") then Some (f.Replace("-r:", "")) else None - - let references = flags |> - Seq.map(fun flag -> match flag with - | Reference ref -> ref - | _ -> "") |> - Seq.where(fun s -> s <> "") - references + flags |> Array.choose(fun flag -> if flag.StartsWith("-r:") then Some(flag.Substring(3)) else None) member this.AddReference(filePath : string) = - this.AddMetadataReferenceAndTryConvertingToProjectReferenceIfPossible(filePath, new MetadataReferenceProperties(), VSConstants.S_FALSE) + this.AddMetadataReferenceAndTryConvertingToProjectReferenceIfPossible(filePath, new MetadataReferenceProperties(), VSConstants.S_FALSE) |> ignore member this.RemoveReference(filePath: string) = this.RemoveMetadataReference(filePath) @@ -75,24 +65,19 @@ type internal FSharpProjectSite(hierarchy: IVsHierarchy, serviceProvider: System member internal this.OnProjectSettingsChanged(hier: IVsHierarchy, site : IProjectSite) = let sourceFiles = site.SourceFilesOnDisk() - // Added files. - sourceFiles |> - Seq.where(fun file -> not(this.ContainsFile(file))) |> - Seq.iter(fun file -> this.AddDocument(hier, file)) - // Removed files. - this.GetCurrentDocuments() |> - Seq.where(fun doc -> not(sourceFiles |> Seq.contains(doc.FilePath))) |> - Seq.iter(fun doc -> this.RemoveDocument(doc)) + // Added files + for file in sourceFiles do if not(this.ContainsFile(file)) then this.AddDocument(hier, file) + // Removed files + let removedDocuments = this.GetCurrentDocuments() |> Seq.where(fun doc -> not(sourceFiles |> Seq.contains(doc.FilePath))) |> Seq.toList + for doc in removedDocuments do this.RemoveDocument(doc) + let references = this.GetReferences(site.CompilerFlags()) + // Added references - references |> - Seq.where(fun ref -> not(this.HasMetadataReference(ref))) |> - Seq.iter(fun ref -> this.AddReference(ref) |> ignore) + for ref in references do if not(this.HasMetadataReference(ref)) then this.AddReference(ref) // Removed references - this.GetCurrentMetadataReferences() |> - Seq.where(fun ref -> not(references |> Seq.contains(ref.FilePath))) |> - Seq.iter(fun ref -> this.RemoveReference(ref.FilePath)) + for ref in this.GetCurrentMetadataReferences() do if not(references |> Seq.contains(ref.FilePath)) then this.RemoveReference(ref.FilePath) // If the order of files changed, that'll be captured in the checkOptions. checkOptions <- Some(ProjectSitesAndFiles.GetProjectOptionsForProjectSite(site, site.ProjectFileName())) \ No newline at end of file diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs b/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs index 7b5e834d621..b403d93d457 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs @@ -751,7 +751,7 @@ See also ...\SetupAuthoring\FSharp\Registry\FSProjSys_Registration.wxs, e.g. override x.GetGuidProperty(propid:int, guid:byref ) = if (enum propid = __VSHPROPID.VSHPROPID_PreferredLanguageSID) then - guid <- new Guid(FSharpCommonConstants.languageServiceGuid) + guid <- new Guid(FSharpCommonConstants.languageServiceGuidString) VSConstants.S_OK // below is how VS decide 'which templates' to associate with an 'add new item' call in this project elif (enum propid = __VSHPROPID2.VSHPROPID_AddItemTemplatesGuid) then