From 4d860b92754cf65155dad4eee606c371af346fd6 Mon Sep 17 00:00:00 2001 From: Petr Date: Mon, 7 Nov 2022 16:39:45 +0100 Subject: [PATCH 1/3] Bunch of crap that hinders my work --- tests/fsharp/FSharpSuite.Tests.fsproj | 1 - tests/fsharp/TypeProviderTests.fs | 391 ------------------ .../src/FSharp.LanguageService.Base/Source.cs | 2 +- .../FSharp.LanguageService.Base/ViewFilter.cs | 8 +- .../ArtificalEventInfo.cs | 1 - .../ArtificialConstructorInfo.cs | 1 - .../ArtificialMethodInfo.cs | 2 +- .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 2 +- .../TypeProviderInCSharp.cs | 9 +- .../ArtificalEventInfo.cs | 2 +- .../ArtificialConstructorInfo.cs | 2 +- .../ArtificialMethodInfo.cs | 1 - .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 2 +- .../TypeProviderInCSharp.cs | 4 +- .../ArtificalEventInfo.cs | 2 +- .../ArtificialConstructorInfo.cs | 1 - .../ArtificialMethodInfo.cs | 1 - .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 2 +- .../TypeProviderInCSharp.cs | 4 +- .../ArtificalEventInfo.cs | 1 - .../ArtificialConstructorInfo.cs | 2 +- .../ArtificialMethodInfo.cs | 2 +- .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 2 +- .../TypeProviderInCSharp.cs | 4 +- .../ArtificalEventInfo.cs | 2 +- .../ArtificialConstructorInfo.cs | 2 +- .../ArtificialMethodInfo.cs | 2 +- .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 1 - .../TypeProviderInCSharp.cs | 4 +- .../tests/MockTypeProviders/Helpers.cs | 15 +- .../ArtificalEventInfo.cs | 2 +- .../ArtificialConstructorInfo.cs | 2 +- .../ArtificialMethodInfo.cs | 2 +- .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 1 - .../TypeProviderInCSharp.cs | 4 +- .../ArtificalEventInfo.cs | 1 - .../ArtificialConstructorInfo.cs | 1 - .../ArtificialMethodInfo.cs | 1 - .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 1 - .../TypeProviderInCSharp.cs | 4 +- .../ArtificalEventInfo.cs | 1 - .../ArtificialConstructorInfo.cs | 1 - .../ArtificialMethodInfo.cs | 1 - .../ArtificialPropertyInfo.cs | 1 - .../ArtificialType.cs | 2 +- .../TypeProviderInCSharp.cs | 4 +- .../ArtificalEventInfo.cs | 2 +- .../ArtificialConstructorInfo.cs | 2 +- .../ArtificialMethodInfo.cs | 2 +- .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 2 +- .../TypeProviderInCSharp.cs | 4 +- .../ArtificalEventInfo.cs | 2 +- .../ArtificialConstructorInfo.cs | 2 +- .../ArtificialMethodInfo.cs | 2 +- .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 2 +- .../TypeProviderInCSharp.cs | 4 +- .../UnitTests/VisualFSharp.UnitTests.fsproj | 12 - 66 files changed, 58 insertions(+), 500 deletions(-) delete mode 100644 tests/fsharp/TypeProviderTests.fs diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index 2ef59aaec06..9d74370a589 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -23,7 +23,6 @@ - diff --git a/tests/fsharp/TypeProviderTests.fs b/tests/fsharp/TypeProviderTests.fs deleted file mode 100644 index fa56bbcc99c..00000000000 --- a/tests/fsharp/TypeProviderTests.fs +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -#if INTERACTIVE -//#r @"../../release/net40/bin/FSharp.Compiler.dll" -#r @"../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" -#load "../../src/scripts/scriptlib.fsx" -#load "../FSharp.Test.Utilities/TestFramework.fs" -#load "single-test.fs" -#else -[] -module FSharp.Test.FSharpSuite.TypeProviderTests -#endif - -open System -open System.IO -open System.Reflection -open NUnit.Framework -open TestFramework -open Scripting -open SingleTest - -open FSharp.Compiler.IO - -#if !NETCOREAPP -// All tests which do a manual invoke of the F# compiler are disabled - -#if NETCOREAPP -// Use these lines if you want to test CoreCLR -let FSC_OPTIMIZED = FSC_NETCORE (true, false) -let FSI = FSI_NETCORE -#else -let FSC_OPTIMIZED = FSC_NETFX (true, false) -let FSI = FSI_NETFX -#endif - -let inline getTestsDirectory dir = getTestsDirectory __SOURCE_DIRECTORY__ dir -let testConfig = getTestsDirectory >> testConfig - -[] -let diamondAssembly () = - let cfg = testConfig "typeProviders/diamondAssembly" - - rm cfg "provider.dll" - - // Add a version flag to make this generate native resources. The native resources aren't important and - // can be dropped when the provided.dll is linked but we need to tolerate generated DLLs that have them - fsc cfg "%s" "--out:provided.dll -a --version:0.0.0.1" [".." ++ "helloWorld" ++ "provided.fs"] - - fsc cfg "%s" "--out:provider.dll -a" [".." ++ "helloWorld" ++ "provider.fsx"] - - fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test1.dll -a" cfg.fsc_flags ["test1.fsx"] - - fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test2a.dll -a -r:test1.dll" cfg.fsc_flags ["test2a.fsx"] - - fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test2b.dll -a -r:test1.dll" cfg.fsc_flags ["test2b.fsx"] - - fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test3.exe -r:test1.dll -r:test2a.dll -r:test2b.dll" cfg.fsc_flags ["test3.fsx"] - - peverify cfg "test1.dll" - - peverify cfg "test2a.dll" - - peverify cfg "test2b.dll" - - peverify cfg "test3.exe" - - exec cfg ("." ++ "test3.exe") "" - - use testOkFile = fileguard cfg "test.ok" - - fsi cfg "%s" cfg.fsi_flags ["test3.fsx"] - - testOkFile.CheckExists() - -[] -let globalNamespace () = - let cfg = testConfig "typeProviders/globalNamespace" - - csc cfg """/out:globalNamespaceTP.dll /debug+ /target:library /r:netstandard.dll /r:"%s" """ cfg.FSCOREDLLPATH ["globalNamespaceTP.cs"] - - fsc cfg "%s /debug+ /r:globalNamespaceTP.dll /optimize-" cfg.fsc_flags ["test.fsx"] - -let helloWorld p = - let cfg = testConfig "typeProviders/helloWorld" - - fsc cfg "%s" "--out:provided1.dll -g -a" [".." ++ "helloWorld" ++ "provided.fs"] - - fsc cfg "%s" "--out:provided2.dll -g -a" [".." ++ "helloWorld" ++ "provided.fs"] - - fsc cfg "%s" "--out:provided3.dll -g -a" [".." ++ "helloWorld" ++ "provided.fs"] - - fsc cfg "%s" "--out:provided4.dll -g -a" [".." ++ "helloWorld" ++ "provided.fs"] - - fsc cfg "%s" "--out:providedJ.dll -g -a" [".." ++ "helloWorld" ++ "providedJ.fs"] - - fsc cfg "%s" "--out:providedK.dll -g -a" [".." ++ "helloWorld" ++ "providedK.fs"] - - fsc cfg "%s" "--out:providedNullAssemblyName.dll -g -a" [".." ++ "helloWorld" ++ "providedNullAssemblyName.fsx"] - - fsc cfg "--out:provided.dll -a" [".." ++ "helloWorld" ++ "provided.fs"] - - fsc cfg "--out:providedJ.dll -a" [".." ++ "helloWorld" ++ "providedJ.fs"] - - fsc cfg "--out:providedK.dll -a" [".." ++ "helloWorld" ++ "providedK.fs"] - - fsc cfg "--out:provider.dll -a" ["provider.fsx"] - - SingleTest.singleTestBuildAndRunAux cfg p - - - rm cfg "provider_with_binary_compat_changes.dll" - - mkdir cfg "bincompat1" - - log "pushd bincompat1" - let bincompat1 = getfullpath cfg "bincompat1" - - Directory.EnumerateFiles(bincompat1 ++ "..", "*.dll") - |> Seq.iter (fun from -> Commands.copy bincompat1 from ("." ++ Path.GetFileName(from)) |> ignore) - - fscIn cfg bincompat1 "%s" "-g -a -o:test_lib.dll -r:provider.dll" [".." ++ "test.fsx"] - - fscIn cfg bincompat1 "%s" "-r:test_lib.dll -r:provider.dll" [".." ++ "testlib_client.fsx"] - - log "popd" - - mkdir cfg "bincompat2" - - log "pushd bincompat2" - let bincompat2 = getfullpath cfg "bincompat2" - - for fromFile in Directory.EnumerateFiles(bincompat2 ++ ".." ++ "bincompat1", "*.dll") do - Commands.copy bincompat2 fromFile ("." ++ Path.GetFileName(fromFile)) |> ignore - - fscIn cfg bincompat2 "%s" "--define:ADD_AN_OPTIONAL_STATIC_PARAMETER --define:USE_IMPLICIT_ITypeProvider2 --out:provider.dll -g -a" [".." ++ "provider.fsx"] - - fscIn cfg bincompat2 "-g -a -o:test_lib_recompiled.dll -r:provider.dll" [".." ++ "test.fsx"] - - fscIn cfg bincompat2 "%s" "--define:ADD_AN_OPTIONAL_STATIC_PARAMETER -r:test_lib.dll -r:provider.dll" [".." ++ "testlib_client.fsx"] - - peverify cfg (bincompat2 ++ "provider.dll") - - peverify cfg (bincompat2 ++ "test_lib.dll") - - peverify cfg (bincompat2 ++ "test_lib_recompiled.dll") - - peverify cfg (bincompat2 ++ "testlib_client.exe") - -[] -let ``helloWorld fsc`` () = helloWorld FSC_OPTIMIZED - -#if !NETCOREAPP -[] -let ``helloWorld fsi`` () = helloWorld FSI_NETFX_STDIN -#endif - -[] -let helloWorldCSharp () = - let cfg = testConfig "typeProviders/helloWorldCSharp" - - rm cfg "magic.dll" - - fsc cfg "%s" "--out:magic.dll -a --keyfile:magic.snk" ["magic.fs "] - - rm cfg "provider.dll" - - csc cfg """/out:provider.dll /target:library "/r:%s" /r:netstandard.dll /r:magic.dll""" cfg.FSCOREDLLPATH ["provider.cs"] - - fsc cfg "%s /debug+ /r:provider.dll /optimize-" cfg.fsc_flags ["test.fsx"] - - peverify cfg "magic.dll" - - peverify cfg "provider.dll" - - peverify cfg "test.exe" - - exec cfg ("." ++ "test.exe") "" - - -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -let ``negative type provider tests`` (name:string) = - let cfg = testConfig "typeProviders/negTests" - let dir = cfg.Directory - - if requireENCulture () then - - let fileExists = Commands.fileExists dir >> Option.isSome - - rm cfg "provided.dll" - - fsc cfg "--out:provided.dll -a" [".." ++ "helloWorld" ++ "provided.fs"] - - rm cfg "providedJ.dll" - - fsc cfg "--out:providedJ.dll -a" [".." ++ "helloWorld" ++ "providedJ.fs"] - - rm cfg "providedK.dll" - - fsc cfg "--out:providedK.dll -a" [".." ++ "helloWorld" ++ "providedK.fs"] - - rm cfg "provider.dll" - - fsc cfg "--out:provider.dll -g --optimize- -a" ["provider.fsx"] - - fsc cfg "--out:provider_providerAttributeErrorConsume.dll -a" ["providerAttributeError.fsx"] - - fsc cfg "--out:provider_ProviderAttribute_EmptyConsume.dll -a" ["providerAttribute_Empty.fsx"] - - rm cfg "helloWorldProvider.dll" - - fsc cfg "--out:helloWorldProvider.dll -g --optimize- -a" [".." ++ "helloWorld" ++ "provider.fsx"] - - rm cfg "MostBasicProvider.dll" - - fsc cfg "--out:MostBasicProvider.dll -g --optimize- -a" ["MostBasicProvider.fsx"] - - let preprocess name pref = - let dirp = (dir |> Commands.pathAddBackslash) - do - FileSystem.OpenFileForReadShim(sprintf "%s%s.%sbslpp" dirp name pref) - .ReadAllText() - .Replace("", getfullpath cfg (sprintf "provider_%s.dll" name)) - .Replace("",dirp) - .Replace("",sprintf "file:///%s" dirp) - |> fun txt -> FileSystem.OpenFileForWriteShim(sprintf "%s%s.%sbsl" dirp name pref).Write(txt) - - if name = "ProviderAttribute_EmptyConsume" || name = "providerAttributeErrorConsume" then () - else fsc cfg "--define:%s --out:provider_%s.dll -a" name name ["provider.fsx"] - - if fileExists (sprintf "%s.bslpp" name) then preprocess name "" - - if fileExists (sprintf "%s.vsbslpp" name) then preprocess name "vs" - - SingleTest.singleNegTest cfg name - -let splitAssembly subdir project = - let subdir = getTestsDirectory subdir - let cfg = testConfig project - - let clean() = - rm cfg "providerDesigner.dll" - rmdir cfg "typeproviders" - rmdir cfg "tools" - rmdir cfg (".." ++ "typeproviders") - rmdir cfg (".." ++ "tools") - - clean() - - fsc cfg "--out:provider.dll -a" ["provider.fs"] - - fsc cfg "--out:providerDesigner.dll -a" ["providerDesigner.fsx"] - - fsc cfg "--out:test.exe -r:provider.dll" ["test.fsx"] - - begin - use testOkFile = fileguard cfg "test.ok" - - exec cfg ("." ++ "test.exe") "" - - testOkFile.CheckExists() - end - - begin - use testOkFile = fileguard cfg "test.ok" - - fsi cfg "%s" cfg.fsi_flags ["test.fsx"] - testOkFile.CheckExists() - end - - // Do the same thing with different load locations for the type provider design-time component - - clean() - - // check a few load locations - let someLoadPaths = - [ subdir ++ "fsharp41" ++ "net48" - subdir ++ "fsharp41" ++ "net472" - subdir ++ "fsharp41" ++ "net461" - subdir ++ "fsharp41" ++ "net45" - // include up one directory - ".." ++ subdir ++ "fsharp41" ++ "net45" - subdir ++ "fsharp41" ++ "netstandard2.0" ] - - for dir in someLoadPaths do - - printfn "" - printfn "Checking load path '%s'" dir - clean() - - // put providerDesigner.dll into a different place - mkdir cfg dir - fsc cfg "--out:%s/providerDesigner.dll -a" dir ["providerDesigner.fsx"] - - fsc cfg "--out:test.exe -r:provider.dll" ["test.fsx"] - - begin - use testOkFile = fileguard cfg "test.ok" - - exec cfg ("." ++ "test.exe") "" - - testOkFile.CheckExists() - end - - begin - use testOkFile = fileguard cfg "test.ok" - - fsi cfg "%s" cfg.fsi_flags ["test.fsx"] - testOkFile.CheckExists() - end - - clean() - -[] -let splitAssemblyTools () = splitAssembly "tools" "typeProviders/splitAssemblyTools" - -[] -let splitAssemblyTypeProviders () = splitAssembly "typeproviders" "typeProviders/splitAssemblyTypeproviders" - -[] -let wedgeAssembly () = - let cfg = testConfig "typeProviders/wedgeAssembly" - - rm cfg "provider.dll" - - rm cfg "provided.dll" - - fsc cfg "%s" "--out:provided.dll -a" [".." ++ "helloWorld" ++ "provided.fs"] - - rm cfg "providedJ.dll" - - fsc cfg "%s" "--out:providedJ.dll -a" [".." ++ "helloWorld" ++ "providedJ.fs"] - - rm cfg "providedK.dll" - - fsc cfg "%s" "--out:providedK.dll -a" [".." ++ "helloWorld" ++ "providedK.fs"] - - fsc cfg "%s" "--out:provider.dll -a" [".." ++ "helloWorld" ++ "provider.fsx"] - - fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test2a.dll -a" cfg.fsc_flags ["test2a.fs"] - - fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test2b.dll -a" cfg.fsc_flags ["test2b.fs"] - - fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test3.exe" cfg.fsc_flags ["test3.fsx"] - - fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test2a-with-sig.dll -a" cfg.fsc_flags ["test2a.fsi"; "test2a.fs"] - - fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test2b-with-sig.dll -a" cfg.fsc_flags ["test2b.fsi"; "test2b.fs"] - - fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test3-with-sig.exe --define:SIGS" cfg.fsc_flags ["test3.fsx"] - - fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test2a-with-sig-restricted.dll -a" cfg.fsc_flags ["test2a-restricted.fsi"; "test2a.fs"] - - fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test2b-with-sig-restricted.dll -a"cfg.fsc_flags ["test2b-restricted.fsi"; "test2b.fs"] - - fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test3-with-sig-restricted.exe --define:SIGS_RESTRICTED" cfg.fsc_flags ["test3.fsx"] - - peverify cfg "test2a.dll" - - peverify cfg "test2b.dll" - - peverify cfg "test3.exe" - - exec cfg ("." ++ "test3.exe") "" -#endif diff --git a/vsintegration/src/FSharp.LanguageService.Base/Source.cs b/vsintegration/src/FSharp.LanguageService.Base/Source.cs index 10f9d2ef9cf..cd8a04a6858 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/Source.cs +++ b/vsintegration/src/FSharp.LanguageService.Base/Source.cs @@ -1243,7 +1243,7 @@ private void HandleMethodTipResponse(BackgroundRequest_DEPRECATED req) Microsoft.FSharp.Core.FSharpOption methodsOpt = req.ResultIntellisenseInfo.GetMethodListForAMethodTip(); if (methodsOpt != null) { - MethodListForAMethodTip_DEPRECATED methods = methodsOpt.Value; + MethodListForAMethodTip_DEPRECATED methods = null; if (methods != null) { diff --git a/vsintegration/src/FSharp.LanguageService.Base/ViewFilter.cs b/vsintegration/src/FSharp.LanguageService.Base/ViewFilter.cs index 5026bc3d022..22c19ee957d 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/ViewFilter.cs +++ b/vsintegration/src/FSharp.LanguageService.Base/ViewFilter.cs @@ -418,10 +418,7 @@ protected virtual int QueryCommandStatus(ref Guid guidCmdGroup, uint nCmdId) { var dbgState = Interactive.Hooks.GetDebuggerState(GetProjectSystemPackage()); - if (dbgState == Interactive.FsiDebuggerState.AttachedNotToFSI) - return (int)OLECMDF.OLECMDF_INVISIBLE; - else - return (int)OLECMDF.OLECMDF_SUPPORTED | (int)OLECMDF.OLECMDF_ENABLED; + return (int)OLECMDF.OLECMDF_SUPPORTED | (int)OLECMDF.OLECMDF_ENABLED; } } @@ -543,12 +540,10 @@ public virtual bool HandlePreExec(ref Guid guidCmdGroup, uint nCmdId, uint nCmde { if (nCmdId == (uint) Microsoft.VisualStudio.VSConstants.VSStd11CmdID.ExecuteSelectionInInteractive) { - Interactive.Hooks.OnMLSend(GetProjectSystemPackage(), Interactive.FsiEditorSendAction.ExecuteSelection, null, null); return true; } else if (nCmdId == (uint) Microsoft.VisualStudio.VSConstants.VSStd11CmdID.ExecuteLineInInteractive) { - Interactive.Hooks.OnMLSend(GetProjectSystemPackage(), Interactive.FsiEditorSendAction.ExecuteLine, null, null); return true; } } @@ -556,7 +551,6 @@ public virtual bool HandlePreExec(ref Guid guidCmdGroup, uint nCmdId, uint nCmde { if (nCmdId == cmdIDDebugSelection) { - Interactive.Hooks.OnMLSend(GetProjectSystemPackage(), Interactive.FsiEditorSendAction.DebugSelection, null, null); return true; } } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs index 47b62e52323..a8db176ee0f 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs @@ -112,7 +112,6 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *event* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 4 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs index 2583ed77293..a72c58214ba 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs @@ -116,7 +116,6 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic .ctor created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs index b97a3fe9f83..8a4a52409c5 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs @@ -143,7 +143,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic *method* created by me!!"))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs index ced1148fc89..87caf376f56 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs @@ -157,7 +157,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *property* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs index e415c1fa7d0..5c5e6e01c1c 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs @@ -734,7 +734,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic type created by me!"))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs index 43ba4cb1b8a..187f1bbf05f 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 : IProvidedNamespace + class Namespace1 { const string _Namespace = "N"; const string _Name = "T"; @@ -45,11 +45,6 @@ public Type[] GetTypes() return new Type[] { myType }; } - public string NamespaceName - { - get { return _Namespace; } - } - public Type ResolveTypeName(string typeName) { @@ -134,7 +129,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { new Namespace1() }; + return new IProvidedNamespace[] { }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs index 0e56fd91093..4fe76358a5c 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs @@ -121,7 +121,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *event* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "Temp.fs", Line = 4 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs index 9604075024e..6df0e0f9713 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs @@ -126,7 +126,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic .ctor created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "Temp.fs", Line = 3 })); + // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs index cb8bfb2d33a..41a3bcda86d 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs @@ -159,7 +159,6 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic *method* created by me!!"))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5, FilePath = "Temp.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs index 8dabf72a4f6..6839190f978 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs @@ -172,7 +172,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *property* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "Temp.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs index 0cd77683ea6..2b8581c8ea2 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs @@ -759,7 +759,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic type created by me!"))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "Temp.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs index ecc8412763e..1e22a8b5002 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 : IProvidedNamespace + class Namespace1 { const string _Namespace = "N"; const string _Name = "T"; @@ -134,7 +134,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { new Namespace1() }; + return new IProvidedNamespace[] { }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs index 7af2e04d731..5e9b20d0298 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs @@ -121,7 +121,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *event* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 50 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs index 98e95ba9b74..5643b32a229 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs @@ -126,7 +126,6 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic .ctor created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 50 })); // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs index 0e49d34733a..41a3bcda86d 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs @@ -159,7 +159,6 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic *method* created by me!!"))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 50 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs index 8dc308a1f6a..8d602e092c6 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs @@ -172,7 +172,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *property* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 50 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs index 2ee8878a0de..bf5b584d8c6 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs @@ -761,7 +761,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic type created by me!"))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 50 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs index 9b56e850af8..973a4ec3a9e 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 : IProvidedNamespace + class Namespace1 { const string _Namespace = "N"; const string _Name = "T"; @@ -124,7 +124,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { new Namespace1() }; + return new IProvidedNamespace[] { }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs index 73b0e81caa1..45630bcb391 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs @@ -122,7 +122,6 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *event* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 4 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs index e4e2aec87d9..6df0e0f9713 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs @@ -126,7 +126,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic .ctor created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs index 94c749ef776..601c9401c27 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs @@ -159,7 +159,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic *method* created by me!!"))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs index 55c379ee910..8d602e092c6 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs @@ -172,7 +172,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *property* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs index 516eb47d9f6..bf5b584d8c6 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs @@ -761,7 +761,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic type created by me!"))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs index 89ea8bcda71..a3b0960fcde 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 : IProvidedNamespace + class Namespace1 { const string _Namespace = "N"; const string _Name = "T T"; @@ -125,7 +125,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { new Namespace1() }; + return new IProvidedNamespace[] { }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs index bd299a9dc6b..4fe76358a5c 100644 --- a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs @@ -121,7 +121,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *event* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs index 098489fa892..ddc85511119 100644 --- a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs @@ -126,7 +126,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic .ctor created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + //attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs index 94c749ef776..601c9401c27 100644 --- a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs @@ -159,7 +159,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic *method* created by me!!"))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs index febe6dd26b0..204cf982574 100644 --- a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs @@ -171,7 +171,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *property* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs index 3b47724351a..78f9cd8171d 100644 --- a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs @@ -759,7 +759,6 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic type created by me!"))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs index ecc8412763e..1e22a8b5002 100644 --- a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 : IProvidedNamespace + class Namespace1 { const string _Namespace = "N"; const string _Name = "T"; @@ -134,7 +134,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { new Namespace1() }; + return new IProvidedNamespace[] { }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/Helpers.cs b/vsintegration/tests/MockTypeProviders/Helpers.cs index 9a2dec4ffba..0a03dbc5c98 100644 --- a/vsintegration/tests/MockTypeProviders/Helpers.cs +++ b/vsintegration/tests/MockTypeProviders/Helpers.cs @@ -30,10 +30,7 @@ public override IList ConstructorArguments { get { - if (_a is TypeProviderXmlDocAttribute) - return new List() { new CustomAttributeTypedArgument(typeof(string), ((TypeProviderXmlDocAttribute)_a).CommentText) }; - else // if (_a is TypeProviderDefinitionLocationAttribute || _a is TypeProviderEditorHideMethodsAttribute) - return new List(); + return new List(); } } @@ -41,15 +38,7 @@ public override IList NamedArguments { get { - if (_a is TypeProviderDefinitionLocationAttribute) - { - var t = _a.GetType(); - return new List() { new CustomAttributeNamedArgument(t.GetProperty("Column"), ((TypeProviderDefinitionLocationAttribute)_a).Column), - new CustomAttributeNamedArgument(t.GetProperty("FilePath"), ((TypeProviderDefinitionLocationAttribute)_a).FilePath), - new CustomAttributeNamedArgument(t.GetProperty("Line"), ((TypeProviderDefinitionLocationAttribute)_a).Line) }; - } - else // if (_a is TypeProviderXmlDocAttribute || _a is TypeProviderEditorHideMethodsAttribute) - return new List(); + return new List(); } } } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs index bd299a9dc6b..4fe76358a5c 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs @@ -121,7 +121,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *event* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs index e4e2aec87d9..6df0e0f9713 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs @@ -126,7 +126,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic .ctor created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs index 94c749ef776..601c9401c27 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs @@ -159,7 +159,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic *method* created by me!!"))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs index 55c379ee910..8d602e092c6 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs @@ -172,7 +172,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *property* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs index 57511e107c1..222a2896eec 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs @@ -759,7 +759,6 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic type created by me!"))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs index ecc8412763e..1e22a8b5002 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 : IProvidedNamespace + class Namespace1 { const string _Namespace = "N"; const string _Name = "T"; @@ -134,7 +134,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { new Namespace1() }; + return new IProvidedNamespace[] { }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs index f3cf9213763..9d285fae7f5 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs @@ -121,7 +121,6 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("")))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5 + this._DeclaringType.Name.Length, FilePath = "", Line = 3 })); // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs index 5dafdd58c89..8aa3a587043 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs @@ -126,7 +126,6 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("")))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5 + this._DeclaringType.Name.Length, FilePath = "", Line = 3 })); // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs index 416cfb3a58b..aa90d5140c0 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs @@ -159,7 +159,6 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("")))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 22 + this._DeclaringType.Name.Length, FilePath = "", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs index 4dac2014d83..3c5ae0ede8e 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs @@ -172,7 +172,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(""))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs index 3afabaa1251..131dc5f6178 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs @@ -759,7 +759,6 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(""))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs index ecc8412763e..1e22a8b5002 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 : IProvidedNamespace + class Namespace1 { const string _Namespace = "N"; const string _Name = "T"; @@ -134,7 +134,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { new Namespace1() }; + return new IProvidedNamespace[] { }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs index 3489764df65..19d174f2aff 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs @@ -121,7 +121,6 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *event* Localized! ኤፍ ሻርፕ for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs index 2c61838f44f..2b857bb7a3d 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs @@ -126,7 +126,6 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic .ctor Localized! ኤፍ ሻርፕ for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5, FilePath = "File.fs", Line = 3 })); // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs index 396fbf47239..86f6d9db576 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs @@ -159,7 +159,6 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic *method* Localized! ኤፍ ሻርፕ"))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs index 4f6a6f739db..7e25a496856 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs @@ -171,7 +171,6 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *property* Localized! ኤፍ ሻርፕ for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs index 17209ccd5db..f54a510fb0c 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs @@ -759,7 +759,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic type Localized! ኤፍ ሻርፕ"))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs index ecc8412763e..1e22a8b5002 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 : IProvidedNamespace + class Namespace1 { const string _Namespace = "N"; const string _Name = "T"; @@ -134,7 +134,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { new Namespace1() }; + return new IProvidedNamespace[] { }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs index 54fefab2f06..f2813586507 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs @@ -121,7 +121,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *event* created by me for {0}.{1}. Which is used to test the tool tip of the typeprovider Event to check if it shows the right message or not.!", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs index 1c2469f0cdc..f6aca5a3ce9 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs @@ -126,7 +126,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic .ctor created by me for {0}.{1}. Which is used to test the tool tip of the typeprovider Constructor to check if it shows the right message or not.!", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs index 58eca203318..07fa251f2ad 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs @@ -159,7 +159,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic *method* created by me!!. Which is used to test the tool tip of the typeprovider Method to check if it shows the right message or not.!"))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs index 7ecc6299e7b..b8b6b1ee17e 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs @@ -172,7 +172,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *property* created by me for {0}.{1}. Which is used to test the tool tip of the typeprovider Property to check if it shows the right message or not.!", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs index 34e1a237518..5161c46c188 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs @@ -759,7 +759,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic type created by me!. Which is used to test the tool tip of the typeprovider type to check if it shows the right message or not."))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs index ecc8412763e..1e22a8b5002 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 : IProvidedNamespace + class Namespace1 { const string _Namespace = "N"; const string _Name = "T"; @@ -134,7 +134,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { new Namespace1() }; + return new IProvidedNamespace[] { }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs index 8fc82a30b1d..3f14efa9449 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs @@ -121,7 +121,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(null))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs index 0e04a726dd8..03b07875898 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs @@ -126,7 +126,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(null))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs index a292de169cd..f7e1a443165 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs @@ -159,7 +159,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(null))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs index 16cef078863..e690fc6e573 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs @@ -171,7 +171,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(null))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs index 1e4299b08f2..b89e6ede322 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs @@ -759,7 +759,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(null))); - attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs index dd7025bf9ed..f2858a69729 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 : IProvidedNamespace + class Namespace1 { const string _Namespace = "N"; const string _Name = "T"; @@ -134,7 +134,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { new Namespace1() }; + return new IProvidedNamespace[] { }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 6889c747714..51d4b9aee64 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -148,18 +148,6 @@ - - - - - - - - - - - - From bfe400bab39609773d3713d6b658a4f83e7a59d7 Mon Sep 17 00:00:00 2001 From: Petr Date: Mon, 7 Nov 2022 16:58:17 +0100 Subject: [PATCH 2/3] Ditch Lens --- docs/tooling-features.md | 1 - .../src/FSharp.Editor/Common/Constants.fs | 4 - .../src/FSharp.Editor/FSharp.Editor.fsproj | 3 - .../src/FSharp.Editor/FSharp.Editor.resx | 3 - .../LanguageService/LanguageService.fs | 1 - .../FSharp.Editor/Lens/LensDisplayService.fs | 348 --------------- .../src/FSharp.Editor/Lens/LensProvider.fs | 63 --- .../src/FSharp.Editor/Lens/LensService.fs | 403 ------------------ .../FSharp.Editor/Options/EditorOptions.fs | 18 - .../FSharp.Editor/xlf/FSharp.Editor.cs.xlf | 5 - .../FSharp.Editor/xlf/FSharp.Editor.de.xlf | 5 - .../FSharp.Editor/xlf/FSharp.Editor.es.xlf | 5 - .../FSharp.Editor/xlf/FSharp.Editor.fr.xlf | 5 - .../FSharp.Editor/xlf/FSharp.Editor.it.xlf | 5 - .../FSharp.Editor/xlf/FSharp.Editor.ja.xlf | 5 - .../FSharp.Editor/xlf/FSharp.Editor.ko.xlf | 5 - .../FSharp.Editor/xlf/FSharp.Editor.pl.xlf | 5 - .../FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf | 5 - .../FSharp.Editor/xlf/FSharp.Editor.ru.xlf | 5 - .../FSharp.Editor/xlf/FSharp.Editor.tr.xlf | 5 - .../xlf/FSharp.Editor.zh-Hans.xlf | 5 - .../xlf/FSharp.Editor.zh-Hant.xlf | 5 - .../FSharp.UIResources/LensOptionControl.xaml | 49 --- .../LensOptionControl.xaml.cs | 28 -- .../FSharp.UIResources/Strings.Designer.cs | 36 -- .../src/FSharp.UIResources/Strings.resx | 12 - .../src/FSharp.UIResources/xlf/Strings.cs.xlf | 20 - .../src/FSharp.UIResources/xlf/Strings.de.xlf | 20 - .../src/FSharp.UIResources/xlf/Strings.es.xlf | 20 - .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 20 - .../src/FSharp.UIResources/xlf/Strings.it.xlf | 20 - .../src/FSharp.UIResources/xlf/Strings.ja.xlf | 20 - .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 20 - .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 20 - .../FSharp.UIResources/xlf/Strings.pt-BR.xlf | 20 - .../src/FSharp.UIResources/xlf/Strings.ru.xlf | 20 - .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 20 - .../xlf/Strings.zh-Hans.xlf | 20 - .../xlf/Strings.zh-Hant.xlf | 20 - 39 files changed, 1294 deletions(-) delete mode 100644 vsintegration/src/FSharp.Editor/Lens/LensDisplayService.fs delete mode 100644 vsintegration/src/FSharp.Editor/Lens/LensProvider.fs delete mode 100644 vsintegration/src/FSharp.Editor/Lens/LensService.fs delete mode 100644 vsintegration/src/FSharp.UIResources/LensOptionControl.xaml delete mode 100644 vsintegration/src/FSharp.UIResources/LensOptionControl.xaml.cs diff --git a/docs/tooling-features.md b/docs/tooling-features.md index 9cad8549f1c..81a689e4f55 100644 --- a/docs/tooling-features.md +++ b/docs/tooling-features.md @@ -42,7 +42,6 @@ Most of the syntax operations require an entire document's source text or parse |---------|---------------|---------------|-----------------| | Most code fixes | Current document's typecheck data | Set (1 or more) of suggested text replacements | S-M | | Semantic classification | Current document's typecheck data | Spans of text with semantic classification type for all constructs in a document | S-L | -| Lenses | Current document's typecheck data and top-level declarations (for showing signatures); graph of all projects that reference the current one (for showing references) | Signature data for each top-level construct; spans of text for each reference to a top-level construct with navigation information | S-XL | | Code generation / refactorings | Current document's typecheck data and/or current resolved symbol/symbols | Text replacement(s) | S-L | | Code completion | Current document's typecheck data and currently-resolved symbol user is typing at | List of all symbols in scope that are "completable" based on where completion is invoked | S-L | | Editor tooltips | Current document's typecheck data and resolved symbol where user invoked a tooltip | F# tooltip data based on inspecting a type and its declarations, then pretty-printing them | S-XL | diff --git a/vsintegration/src/FSharp.Editor/Common/Constants.fs b/vsintegration/src/FSharp.Editor/Common/Constants.fs index 3a97a88d5f4..7d72967e0e3 100644 --- a/vsintegration/src/FSharp.Editor/Common/Constants.fs +++ b/vsintegration/src/FSharp.Editor/Common/Constants.fs @@ -81,10 +81,6 @@ module internal Guids = /// "9A66EB6A-DE52-4169-BC26-36FBD4312FD7" let codeFixesOptionPageIdString = "9A66EB6A-DE52-4169-BC26-36FBD4312FD7" - [] - /// "00BE7FD9-8145-4A2E-A1BF-3BAF0F4F47DD" - let lensOptionPageIdString = "00BE7FD9-8145-4A2E-A1BF-3BAF0F4F47DD" - [] /// "8FDA964A-263D-4B4E-9560-29897535217C" let languageServicePerformanceOptionPageIdString = "8FDA964A-263D-4B4E-9560-29897535217C" diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index ab04e3f105e..b0b4cae70e3 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -133,9 +133,6 @@ - - - diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx index 45b92f2b251..aef0a57ec06 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx @@ -177,9 +177,6 @@ Advanced - - Lens - Formatting diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 05dc5f739fb..1c212ab933b 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -198,7 +198,6 @@ type internal FSharpSettingsFactory [, "F#", null, "Code Fixes", "6010")>] [, "F#", null, "Performance", "6011")>] [, "F#", null, "Advanced", "6012")>] -[, "F#", null, "Lens", "6013")>] [, "F#", null, "Formatting", "6014")>] [] // 64 represents a hex number. It needs to be greater than 37 so the TextMate editor will not be chosen as higher priority. diff --git a/vsintegration/src/FSharp.Editor/Lens/LensDisplayService.fs b/vsintegration/src/FSharp.Editor/Lens/LensDisplayService.fs deleted file mode 100644 index 2e86cc9a052..00000000000 --- a/vsintegration/src/FSharp.Editor/Lens/LensDisplayService.fs +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Microsoft.VisualStudio.FSharp.Editor - -open System -open System.Windows.Controls -open Microsoft.VisualStudio.FSharp.Editor.Logging -open Microsoft.VisualStudio.Text -open Microsoft.VisualStudio.Text.Editor -open Microsoft.VisualStudio.Text.Formatting -open System.Threading -open System.Windows -open System.Collections.Generic - -type LensDisplayService (view : IWpfTextView, buffer : ITextBuffer) as self = - - // Add buffer changed event handler - do ( - buffer.Changed.Add self.HandleBufferChanged - view.LayoutChanged.Add self.HandleLayoutChanged - ) - - /// - /// Enqueing an unit signals to the tagger that all visible lens must be layouted again, - /// to respect single line changes. - /// - member val RelayoutRequested : Queue<_> = Queue() with get - - member val WpfView = view - - member val TextBuffer = buffer - - /// Saves the ui context to switch context for ui related work. - member val UiContext = SynchronizationContext.Current - - // Tracks the created ui elements per TrackingSpan - member val UiElements = Dictionary<_,Grid>() - - member val TrackingSpanUiParent = HashSet() - - member val UiElementNeighbour = Dictionary() - - /// Caches the current used TrackingSpans per line. One line can contain multiple trackingSpans - member val TrackingSpans = Dictionary>() - - /// Text view for accessing the adornment layer. - member val View: IWpfTextView = view - - member val LensLayer = view.GetAdornmentLayer "Lens" - - /// Tracks the recent first + last visible line numbers for adornment layout logic. - member val RecentFirstVsblLineNmbr = 0 with get, set - - member val RecentLastVsblLineNmbr = 0 with get, set - - /// Tracks the adornments on the layer. - member val AddedAdornments = HashSet() - - /// Cancellation token source for the layout changed event. Needed to abort previous async-work. - member val LayoutChangedCts = new CancellationTokenSource() with get, set - - /// Tracks the last used buffer snapshot, should be preferred used in combination with mutex. - member val CurrentBufferSnapshot = null with get, set - - /// Helper method which returns the start line number of a tracking span - member _.GetTrackingSpanStartLine (snapshot:ITextSnapshot) (trackingSpan:ITrackingSpan) = - snapshot.GetLineNumberFromPosition(trackingSpan.GetStartPoint(snapshot).Position) - - /// Helper method which returns the start line number of a tracking span - member _.TryGetTSpanStartLine (snapshot:ITextSnapshot) (trackingSpan:ITrackingSpan) = - let pos = trackingSpan.GetStartPoint(snapshot).Position - if snapshot.Length - 1 < pos then None - else pos |> snapshot.GetLineNumberFromPosition |> Some - - member self.UpdateTrackingSpansFast (snapshot:ITextSnapshot) lineNumber = - if lineNumber |> self.TrackingSpans.ContainsKey then - let currentTrackingSpans = self.TrackingSpans.[lineNumber] |> ResizeArray // We need a copy because we modify the list. - for trackingSpan in currentTrackingSpans do - let newLineOption = self.TryGetTSpanStartLine snapshot trackingSpan - match newLineOption with - | None -> () - | Some newLine -> - if newLine <> lineNumber then - // We're on a new line and need to check whether we're currently in another grid - // (because somehow there were multiple trackingSpans per line). - if self.TrackingSpanUiParent.Contains trackingSpan then - self.TrackingSpanUiParent.Remove trackingSpan |> ignore - self.UiElementNeighbour.Remove self.UiElements.[trackingSpan] |> ignore - // remove our entry in the line cache dictionary - self.TrackingSpans.[lineNumber].Remove(trackingSpan) |> ignore - // if the cache entry for the old line is now empty remove it completely - if self.TrackingSpans.[lineNumber].Count = 0 then - self.TrackingSpans.Remove lineNumber |> ignore - // now re-register our tracking span in the cache dict. - // Check whether the new line has no existing entry to add a fresh one. - // If there is already one we put our grid into the grid of the first entry of the line. - if newLine |> self.TrackingSpans.ContainsKey |> not then - self.TrackingSpans.[newLine] <- ResizeArray() - else - let neighbour = - self.UiElements.[self.TrackingSpans.[newLine] |> Seq.last] // This fails if a tracking span has no ui element! - self.UiElementNeighbour.[self.UiElements.[trackingSpan]] <- neighbour - self.TrackingSpanUiParent.Add trackingSpan |> ignore - // And finally add us to the cache again. - self.TrackingSpans.[newLine].Add(trackingSpan) - // Be sure that the uiElement of the trackingSpan is viRecentLastVsblLineNmbr the visible line space. - if newLine < self.RecentFirstVsblLineNmbr || newLine > self.RecentLastVsblLineNmbr then - if self.UiElements.ContainsKey trackingSpan then - let mutable element = self.UiElements.[trackingSpan] - element.Visibility <- Visibility.Hidden - - member _.CreateDefaultStackPanel () = - let grid = Grid(Visibility = Visibility.Hidden) - Canvas.SetLeft(grid, 0.) - Canvas.SetTop(grid, 0.) - grid - - /// Helper methods which invokes every action which is needed for new trackingSpans - member self.AddTrackingSpan (trackingSpan:ITrackingSpan)= - let snapshot = buffer.CurrentSnapshot - let startLineNumber = snapshot.GetLineNumberFromPosition(trackingSpan.GetStartPoint(snapshot).Position) - let uiElement = - if self.UiElements.ContainsKey trackingSpan then -#if DEBUG - logErrorf "Added a tracking span twice, this is not allowed and will result in invalid values! %A" (trackingSpan.GetText snapshot) -#endif - self.UiElements.[trackingSpan] - else - let defaultStackPanel = self.CreateDefaultStackPanel() - self.UiElements.[trackingSpan] <- defaultStackPanel - defaultStackPanel - if self.TrackingSpans.ContainsKey startLineNumber then - self.TrackingSpans.[startLineNumber].Add trackingSpan - let neighbour = - self.UiElements.[self.TrackingSpans.[startLineNumber] |> Seq.last] // This fails if a tracking span has no ui element! - self.UiElementNeighbour.[uiElement] <- neighbour - self.TrackingSpanUiParent.Add trackingSpan |> ignore - else - self.TrackingSpans.[startLineNumber] <- ResizeArray() - self.TrackingSpans.[startLineNumber].Add trackingSpan - uiElement - - - member self.HandleBufferChanged(e:TextContentChangedEventArgs) = - try - let oldSnapshot = e.Before - let snapshot = e.After - self.CurrentBufferSnapshot <- snapshot - for line in oldSnapshot.Lines do - let lineNumber = line.LineNumber - self.UpdateTrackingSpansFast snapshot lineNumber - let firstLine = view.TextViewLines.FirstVisibleLine - view.DisplayTextLineContainingBufferPosition (firstLine.Start, 0., ViewRelativePosition.Top) - self.RelayoutRequested.Enqueue(()) - with e -> -#if DEBUG - logErrorf "Error in lens provider: %A" e -#else - ignore e -#endif - - /// Public non-thread-safe method to add lens for a given tracking span. - /// Returns an UIElement which can be used to add Ui elements and to remove the lens later. - member self.AddLens (trackingSpan:ITrackingSpan) = - if trackingSpan.TextBuffer <> buffer then failwith "TrackingSpan text buffer does not equal with Lens text buffer" - let Grid = self.AddTrackingSpan trackingSpan - self.RelayoutRequested.Enqueue(()) - Grid :> UIElement - - /// Public non-thread-safe method to remove lens for a given tracking span. - member self.RemoveLens (trackingSpan:ITrackingSpan) = - if self.UiElements.ContainsKey trackingSpan then - let Grid = self.UiElements.[trackingSpan] - Grid.Children.Clear() - self.UiElements.Remove trackingSpan |> ignore - try - self.LensLayer.RemoveAdornment(Grid) - with e -> -#if DEBUG - logExceptionWithContext(e, "Removing lens") -#else - ignore e -#endif -#if DEBUG - else - logWarningf "No ui element is attached to this tracking span!" -#endif - let lineNumber = - (trackingSpan.GetStartPoint self.CurrentBufferSnapshot).Position - |> self.CurrentBufferSnapshot.GetLineNumberFromPosition - if self.TrackingSpans.ContainsKey lineNumber then -#if DEBUG - if self.TrackingSpans.[lineNumber].Remove trackingSpan |> not then - logWarningf "No tracking span is accociated with this line number %d!" lineNumber -#endif - if self.TrackingSpans.[lineNumber].Count = 0 then - self.TrackingSpans.Remove lineNumber |> ignore -#if DEBUG - else - logWarningf "No tracking span is accociated with this line number %d!" lineNumber -#endif - - member self.AddUiElementToLens (trackingSpan:ITrackingSpan, uiElement:UIElement) = - let Grid = self.UiElements.[trackingSpan] - Grid.Children.Add uiElement |> ignore - - member self.AddUiElementToLensOnce (trackingSpan:ITrackingSpan, uiElement:UIElement)= - let Grid = self.UiElements.[trackingSpan] - if uiElement |> Grid.Children.Contains |> not then - self.AddUiElementToLens (trackingSpan, uiElement) - - member self.RemoveUiElementFromLens (trackingSpan:ITrackingSpan, uiElement:UIElement) = - let Grid = self.UiElements.[trackingSpan] - Grid.Children.Remove(uiElement) |> ignore - - member self.HandleLayoutChanged (e:TextViewLayoutChangedEventArgs) = - try - // We can cancel existing stuff because the algorithm supports abortion without any data loss - self.LayoutChangedCts.Cancel() - self.LayoutChangedCts.Dispose() - self.LayoutChangedCts <- new CancellationTokenSource() - let buffer = e.NewSnapshot - let recentVisibleLineNumbers = Set [self.RecentFirstVsblLineNmbr .. self.RecentLastVsblLineNmbr] - let firstVisibleLineNumber, lastVisibleLineNumber = - let first, last = - view.TextViewLines.FirstVisibleLine, - view.TextViewLines.LastVisibleLine - buffer.GetLineNumberFromPosition(first.Start.Position), - buffer.GetLineNumberFromPosition(last.Start.Position) - let visibleLineNumbers = Set [firstVisibleLineNumber .. lastVisibleLineNumber] - let nonVisibleLineNumbers = Set.difference recentVisibleLineNumbers visibleLineNumbers - let newVisibleLineNumbers = Set.difference visibleLineNumbers recentVisibleLineNumbers - - let applyFuncOnLineStackPanels (line:IWpfTextViewLine) (func:Grid -> unit) = - let lineNumber = line.Snapshot.GetLineNumberFromPosition(line.Start.Position) - if (self.TrackingSpans.ContainsKey lineNumber) && (self.TrackingSpans.[lineNumber]) |> (Seq.isEmpty >> not) then - for trackingSpan in self.TrackingSpans.[lineNumber] do - let success, ui = self.UiElements.TryGetValue trackingSpan - if success then - func ui - - if nonVisibleLineNumbers.Count > 0 || newVisibleLineNumbers.Count > 0 then - for lineNumber in nonVisibleLineNumbers do - if lineNumber > 0 && lineNumber < buffer.LineCount then - try - let line = - (buffer.GetLineFromLineNumber lineNumber).Start - |> view.GetTextViewLineContainingBufferPosition - applyFuncOnLineStackPanels line (fun ui -> - ui.Visibility <- Visibility.Hidden - ) - with e -> -#if DEBUG - logErrorf "Error in non visible lines iteration %A" e -#else - ignore e -#endif - for lineNumber in newVisibleLineNumbers do - try - let line = - (buffer.GetLineFromLineNumber lineNumber).Start - |> view.GetTextViewLineContainingBufferPosition - applyFuncOnLineStackPanels line (fun ui -> - ui.Visibility <- Visibility.Visible - self.LayoutUIElementOnLine view line ui - ) - with e -> -#if DEBUG - logErrorf "Error in new visible lines iteration %A" e -#else - ignore e -#endif - if not e.VerticalTranslation && e.NewViewState.ViewportHeight <> e.OldViewState.ViewportHeight then - self.RelayoutRequested.Enqueue() // Unfortunately zooming requires a relayout too, to ensure that no weird layout happens due to unkown reasons. - if self.RelayoutRequested.Count > 0 then - self.RelayoutRequested.Dequeue() |> ignore - for lineNumber in visibleLineNumbers do - let line = - (buffer.GetLineFromLineNumber lineNumber).Start - |> view.GetTextViewLineContainingBufferPosition - applyFuncOnLineStackPanels line (fun ui -> - ui.Visibility <- Visibility.Visible - self.LayoutUIElementOnLine view line ui - ) - // Save the new first and last visible lines for tracking - self.RecentFirstVsblLineNmbr <- firstVisibleLineNumber - self.RecentLastVsblLineNmbr <- lastVisibleLineNumber - - self.AsyncCustomLayoutOperation visibleLineNumbers buffer - |> RoslynHelpers.StartAsyncSafe self.LayoutChangedCts.Token "HandleLayoutChanged" - with e -> -#if DEBUG - logExceptionWithContext (e, "Layout changed") -#else - ignore e -#endif - - /// Layouts all stack panels on the line - member self.LayoutUIElementOnLine _ (line:ITextViewLine) (ui:Grid) = - let left, top = - try - let bounds = line.GetCharacterBounds(line.Start) - line.TextRight + 5.0, bounds.Top - 1. - with e -> -#if DEBUG - logExceptionWithContext (e, "Error in layout ui element on line") -#else - ignore e -#endif - Canvas.GetLeft ui, Canvas.GetTop ui - Canvas.SetLeft(ui, left) - Canvas.SetTop(ui, top) - - member self.AsyncCustomLayoutOperation visibleLineNumbers buffer = - asyncMaybe { - // Suspend 5 ms, instantly applying the layout to the adornment elements isn't needed - // and would consume too much performance - do! Async.Sleep(5) |> liftAsync // Skip at least one frames - do! Async.SwitchToContext self.UiContext |> liftAsync - let layer = self.LensLayer - do! Async.Sleep(495) |> liftAsync - try - for visibleLineNumber in visibleLineNumbers do - if self.TrackingSpans.ContainsKey visibleLineNumber then - self.TrackingSpans.[visibleLineNumber] - |> Seq.map (fun trackingSpan -> - let success, res = self.UiElements.TryGetValue trackingSpan - if success then - res - else null - ) - |> Seq.filter (fun ui -> not(isNull ui) && not(self.AddedAdornments.Contains ui)) - |> Seq.iter(fun grid -> - layer.AddAdornment(AdornmentPositioningBehavior.OwnerControlled, Nullable(), - self, grid, AdornmentRemovedCallback(fun _ _ -> self.AddedAdornments.Remove grid |> ignore)) |> ignore - self.AddedAdornments.Add grid |> ignore - let line = - let l = buffer.GetLineFromLineNumber visibleLineNumber - view.GetTextViewLineContainingBufferPosition l.Start - self.LayoutUIElementOnLine view line grid - ) - with e -> -#if DEBUG - logExceptionWithContext (e, "LayoutChanged, processing new visible lines") -#else - ignore e -#endif - } |> Async.Ignore \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Lens/LensProvider.fs b/vsintegration/src/FSharp.Editor/Lens/LensProvider.fs deleted file mode 100644 index 254fe539364..00000000000 --- a/vsintegration/src/FSharp.Editor/Lens/LensProvider.fs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Microsoft.VisualStudio.FSharp.Editor - -open System -open Microsoft.VisualStudio.Text -open Microsoft.VisualStudio.Text.Editor -open System.ComponentModel.Composition -open Microsoft.VisualStudio.Utilities -open Microsoft.VisualStudio.Shell -open Microsoft.VisualStudio -open Microsoft.VisualStudio.LanguageServices -open Microsoft.VisualStudio.Text.Tagging -open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.Shared.Utilities - -[)>] -[)>] -[] -[] -type internal LensProvider - [] - ( - [)>] serviceProvider: IServiceProvider, - textDocumentFactory: ITextDocumentFactoryService, - metadataAsSource: FSharpMetadataAsSourceService, - typeMap : FSharpClassificationTypeMap Lazy, - settings: EditorOptions - ) = - - let tryGetTextDocument (buffer: ITextBuffer) (factory: ITextDocumentFactoryService) = - match factory.TryGetTextDocument buffer with - | true, document -> Some document - | _ -> None - - let lensProviders = ResizeArray() - let componentModel = Package.GetGlobalService(typeof) :?> ComponentModelHost.IComponentModel - let workspace = componentModel.GetService() - - let addLensProvider wpfView buffer = - textDocumentFactory - |> tryGetTextDocument buffer - |> Option.map (fun document -> workspace.CurrentSolution.GetDocumentIdsWithFilePath(document.FilePath)) - |> Option.bind Seq.tryHead - |> Option.map (fun documentId -> - let service = LensService(serviceProvider, workspace, documentId, buffer, metadataAsSource, componentModel.GetService(), typeMap, LensDisplayService(wpfView, buffer), settings) - let provider = (wpfView, service) - wpfView.Closed.Add (fun _ -> lensProviders.Remove provider |> ignore) - lensProviders.Add(provider)) - - [); Name("Lens"); - Order(Before = PredefinedAdornmentLayers.Text); - TextViewRole(PredefinedTextViewRoles.Document)>] - member val LensAdornmentLayerDefinition : AdornmentLayerDefinition = null with get, set - - interface IWpfTextViewCreationListener with - override _.TextViewCreated view = - if settings.Lens.Enabled then - let provider = - lensProviders - |> Seq.tryFind (fun (v, _) -> v = view) - - if provider.IsNone then - addLensProvider view (view.TextBuffer) |> ignore \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Lens/LensService.fs b/vsintegration/src/FSharp.Editor/Lens/LensService.fs deleted file mode 100644 index 2a9724981de..00000000000 --- a/vsintegration/src/FSharp.Editor/Lens/LensService.fs +++ /dev/null @@ -1,403 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Microsoft.VisualStudio.FSharp.Editor - - -open System -open System.Collections.Generic -open System.Threading -open System.Windows -open System.Windows.Controls -open System.Windows.Media -open System.Windows.Media.Animation - -open Microsoft.CodeAnalysis -open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Classification -open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.Shared.Extensions - -open FSharp.Compiler.Symbols -open FSharp.Compiler.Syntax -open FSharp.Compiler.Text - -open Microsoft.VisualStudio.FSharp.Editor.Logging -open Microsoft.VisualStudio.Shell.Interop -open Microsoft.VisualStudio.Text -open Microsoft.VisualStudio.Text.Classification - -open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.Shared.Utilities - -type internal Lens(taggedText, computed, funcID, uiElement) = - member val TaggedText: Async<(ResizeArray * FSharpNavigation) option> = taggedText - member val Computed: bool = computed with get, set - member val FuncID: string = funcID - member val UiElement: UIElement = uiElement with get, set - -type internal LensService - ( - serviceProvider: IServiceProvider, - workspace: Workspace, - documentId: DocumentId, - buffer: ITextBuffer, - metadataAsSource: FSharpMetadataAsSourceService, - classificationFormatMapService: IClassificationFormatMapService, - typeMap: Lazy, - lensDisplayService : LensDisplayService, - settings: EditorOptions - ) as self = - - let visit pos parseTree = - SyntaxTraversal.Traverse(pos, parseTree, { new SyntaxVisitorBase<_>() with - member _.VisitExpr(_path, traverseSynExpr, defaultTraverse, expr) = - defaultTraverse(expr) - - override _.VisitInheritSynMemberDefn (_, _, _, _, _, range) = Some range - - override _.VisitTypeAbbrev(_, _, range) = Some range - - override _.VisitLetOrUse(_, _, _, bindings, range) = - match bindings |> Seq.tryFind (fun b -> b.RangeOfHeadPattern.StartLine = pos.Line) with - | Some entry -> - Some entry.RangeOfBindingWithRhs - | None -> - // We choose to use the default range because - // it wasn't possible to find the complete range - // including implementation code. - Some range - - override _.VisitBinding (_, fn, binding) = - Some binding.RangeOfBindingWithRhs - }) - - let formatMap = lazy classificationFormatMapService.GetClassificationFormatMap "tooltip" - - let mutable lastResults = Dictionary() - let mutable firstTimeChecked = false - let mutable bufferChangedCts = new CancellationTokenSource() - let uiContext = SynchronizationContext.Current - - let layoutTagToFormatting (layoutTag: TextTag) = - layoutTag - |> RoslynHelpers.roslynTag - |> FSharpClassificationTags.GetClassificationTypeName - |> typeMap.Value.GetClassificationType - |> formatMap.Value.GetTextProperties - - let createTextBox (lens:Lens) = - async { - do! Async.SwitchToContext uiContext - let! res = lens.TaggedText - match res with - | Some (taggedText, navigation) -> -#if DEBUG - logInfof "Tagged text %A" taggedText -#endif - let textBlock = new TextBlock(Background = Brushes.AliceBlue, Opacity = 0.0, TextTrimming = TextTrimming.None) - FSharpDependencyObjectExtensions.SetDefaultTextProperties(textBlock, formatMap.Value) - - let prefix = Documents.Run settings.Lens.Prefix - prefix.Foreground <- SolidColorBrush(Color.FromRgb(153uy, 153uy, 153uy)) - textBlock.Inlines.Add prefix - - for text in taggedText do - - let coloredProperties = layoutTagToFormatting text.Tag - let actualProperties = - if settings.Lens.UseColors - then - // If color is gray (R=G=B), change to correct gray color. - // Otherwise, use the provided color. - match coloredProperties.ForegroundBrush with - | :? SolidColorBrush as b -> - let c = b.Color - if c.R = c.G && c.R = c.B - then coloredProperties.SetForeground(Color.FromRgb(153uy, 153uy, 153uy)) - else coloredProperties - | _ -> coloredProperties - else - coloredProperties.SetForeground(Color.FromRgb(153uy, 153uy, 153uy)) - - let run = Documents.Run text.Text - FSharpDependencyObjectExtensions.SetTextProperties (run, actualProperties) - - let inl = - match text with - | :? NavigableTaggedText as nav when navigation.IsTargetValid nav.Range -> - let h = Documents.Hyperlink(run, ToolTip = nav.Range.FileName) - h.Click.Add (fun _ -> - navigation.NavigateTo(nav.Range, CancellationToken.None)) - h :> Documents.Inline - | _ -> run :> _ - FSharpDependencyObjectExtensions.SetTextProperties (inl, actualProperties) - textBlock.Inlines.Add inl - - - textBlock.Measure(Size(Double.PositiveInfinity, Double.PositiveInfinity)) - lens.Computed <- true - lens.UiElement <- textBlock - return true - | _ -> - return false - } - - let executeLensAsync () = - asyncMaybe { - do! Async.Sleep 800 |> liftAsync -#if DEBUG - logInfof "Rechecking code due to buffer edit!" -#endif - let! document = workspace.CurrentSolution.GetDocument documentId |> Option.ofObj - let! parseFileResults, checkFileResults = document.GetFSharpParseAndCheckResultsAsync(nameof(FSharpUseMutationWhenValueIsMutableFixProvider)) |> liftAsync - let parsedInput = parseFileResults.ParseTree -#if DEBUG - logInfof "Getting uses of all symbols!" -#endif - let! ct = Async.CancellationToken |> liftAsync - let symbolUses = checkFileResults.GetAllUsesOfAllSymbolsInFile(ct) - let textSnapshot = buffer.CurrentSnapshot -#if DEBUG - logInfof "Updating due to buffer edit!" -#endif - // Clear existing data and cache flags - // The results which are left. - let oldResults = Dictionary(lastResults) - - let newResults = Dictionary() - // Symbols which cache wasn't found yet - let unattachedSymbols = ResizeArray() - // Tags which are new or need to be updated due to changes. - let tagsToUpdate = Dictionary() - let lensToAdd = ResizeArray() - - let useResults (displayContext: FSharpDisplayContext, func: FSharpMemberOrFunctionOrValue, realPosition: range) = - async { - try - let textSnapshot = buffer.CurrentSnapshot - let lineNumber = Line.toZ func.DeclarationLocation.StartLine - if (lineNumber >= 0 || lineNumber < textSnapshot.LineCount) then - match func.FullTypeSafe with - | Some _ -> - let maybeContext = checkFileResults.GetDisplayContextForPos(func.DeclarationLocation.Start) - - let displayContext = Option.defaultValue displayContext maybeContext - let typeLayout = func.FormatLayout displayContext - let taggedText = ResizeArray() - typeLayout |> Seq.iter taggedText.Add - let statusBar = StatusBar(serviceProvider.GetService()) - let navigation = FSharpNavigation(statusBar, metadataAsSource, document, realPosition) - // Because the data is available notify that this line should be updated, displaying the results - return Some (taggedText, navigation) - | None -> -#if DEBUG - logWarningf "Couldn't acquire Lens data for function %A" func -#endif - return None - else return None - with e -> -#if DEBUG - logErrorf "Error in lazy lens computation. %A" e -#else - ignore e -#endif - return None - } - - let inline setNewResultsAndWarnIfOverriden fullDeclarationText value = -#if DEBUG - if newResults.ContainsKey fullDeclarationText then - logWarningf "New results already contains: %A" fullDeclarationText -#endif - newResults.[fullDeclarationText] <- value - - for symbolUse in symbolUses do - if symbolUse.IsFromDefinition then - match symbolUse.Symbol with - | :? FSharpMemberOrFunctionOrValue as func when func.IsModuleValueOrMember || func.IsProperty -> - let funcID = func.LogicalName + (func.FullType.ToString() |> hash |> string) - // Try to re-use the last results - if lastResults.ContainsKey funcID then - // Make sure that the results are usable - let inline setNewResultsAndWarnIfOverridenLocal value = setNewResultsAndWarnIfOverriden funcID value - let lastTrackingSpan, lens as lastResult = lastResults.[funcID] - if lens.FuncID = funcID then - setNewResultsAndWarnIfOverridenLocal lastResult - oldResults.Remove funcID |> ignore - else - let declarationLine, range = - match visit func.DeclarationLocation.Start parsedInput with - | Some range -> range.StartLine - 1, range - | _ -> func.DeclarationLocation.StartLine - 1, func.DeclarationLocation - // Track the old element for removal - let declarationSpan = - let line = textSnapshot.GetLineFromLineNumber declarationLine - let offset = line.GetText() |> Seq.findIndex (Char.IsWhiteSpace >> not) - SnapshotSpan(line.Start.Add offset, line.End).Span - let newTrackingSpan = - textSnapshot.CreateTrackingSpan(declarationSpan, SpanTrackingMode.EdgeExclusive) - // Push back the new results - let res = - Lens( Async.cache (useResults (symbolUse.DisplayContext, func, range)), - false, - funcID, - null) - // The old results aren't computed at all, because the line might have changed create new results - tagsToUpdate.[lastTrackingSpan] <- (newTrackingSpan, funcID, res) - setNewResultsAndWarnIfOverridenLocal (newTrackingSpan, res) - - oldResults.Remove funcID |> ignore - else - // The symbol might be completely new or has slightly changed. - // We need to track this and iterate over the left entries to ensure that there isn't anything - unattachedSymbols.Add(symbolUse, func, funcID) - | _ -> () - - // In best case this works quite `covfefe` fine because often enough we change only a small part of the file and not the complete. - for unattachedSymbol in unattachedSymbols do - let symbolUse, func, funcID = unattachedSymbol - let declarationLine, range = - match visit func.DeclarationLocation.Start parsedInput with - | Some range -> range.StartLine - 1, range - | _ -> func.DeclarationLocation.StartLine - 1, func.DeclarationLocation - - let test (v:KeyValuePair<_, _>) = - let _, (lens:Lens) = v.Value - lens.FuncID = funcID - match oldResults |> Seq.tryFind test with - | Some res -> - let (trackingSpan : ITrackingSpan), (lens : Lens) = res.Value - let declarationSpan = - let line = textSnapshot.GetLineFromLineNumber declarationLine - let offset = line.GetText() |> Seq.findIndex (Char.IsWhiteSpace >> not) - SnapshotSpan(line.Start.Add offset, line.End).Span - let newTrackingSpan = - textSnapshot.CreateTrackingSpan(declarationSpan, SpanTrackingMode.EdgeExclusive) - if lens.Computed && (isNull lens.UiElement |> not) then - newResults.[funcID] <- (newTrackingSpan, lens) - tagsToUpdate.[trackingSpan] <- (newTrackingSpan, funcID, lens) - else - let res = - Lens( - Async.cache (useResults (symbolUse.DisplayContext, func, range)), - false, - funcID, - null) - // The tag might be still valid but it hasn't been computed yet so create fresh results - tagsToUpdate.[trackingSpan] <- (newTrackingSpan, funcID, res) - newResults.[funcID] <- (newTrackingSpan, res) - let key = res.Key - oldResults.Remove key |> ignore // no need to check this entry again - | None -> - // This function hasn't got any cache and so it's completely new. - // So create completely new results - // And finally add a tag for this. - let res = - Lens( - Async.cache (useResults (symbolUse.DisplayContext, func, range)), - false, - funcID, - null) - try - let declarationSpan = - let line = textSnapshot.GetLineFromLineNumber declarationLine - let offset = line.GetText() |> Seq.findIndex (Char.IsWhiteSpace >> not) - SnapshotSpan(line.Start.Add offset, line.End).Span - let trackingSpan = - textSnapshot.CreateTrackingSpan(declarationSpan, SpanTrackingMode.EdgeExclusive) - lensToAdd.Add (trackingSpan, res) - newResults.[funcID] <- (trackingSpan, res) - with e -> -#if DEBUG - logExceptionWithContext (e, "Lens tracking tag span creation") -#endif - ignore e - () - lastResults <- newResults - do! Async.SwitchToContext uiContext |> liftAsync - let createLensUIElement (lens:Lens) trackingSpan _ = - if lens.Computed |> not then - async { - let! res = createTextBox lens - if res then - do! Async.SwitchToContext uiContext -#if DEBUG - logInfof "Adding ui element for %A" (lens.TaggedText) -#endif - let uiElement = lens.UiElement - let animation = - DoubleAnimation( - To = Nullable 0.8, - Duration = (TimeSpan.FromMilliseconds 800. |> Duration.op_Implicit), - EasingFunction = QuadraticEase() - ) - let sb = Storyboard() - Storyboard.SetTarget(sb, uiElement) - Storyboard.SetTargetProperty(sb, PropertyPath Control.OpacityProperty) - sb.Children.Add animation - lensDisplayService.AddUiElementToLensOnce (trackingSpan, uiElement) - lensDisplayService.RelayoutRequested.Enqueue () - sb.Begin() - else -#if DEBUG - logWarningf "Couldn't retrieve lens information for %A" lens.FuncID -#endif - () - } |> (RoslynHelpers.StartAsyncSafe CancellationToken.None) "UIElement creation" - - for value in tagsToUpdate do - let trackingSpan, (newTrackingSpan, _, lens) = value.Key, value.Value - lensDisplayService.RemoveLens trackingSpan |> ignore - let Grid = lensDisplayService.AddLens newTrackingSpan - if lens.Computed && (isNull lens.UiElement |> not) then - let uiElement = lens.UiElement - lensDisplayService.AddUiElementToLensOnce (newTrackingSpan, uiElement) - else - Grid.IsVisibleChanged - |> Event.filter (fun eventArgs -> eventArgs.NewValue :?> bool) - |> Event.add (createLensUIElement lens newTrackingSpan) - - for value in lensToAdd do - let trackingSpan, lens = value - let Grid = lensDisplayService.AddLens trackingSpan -#if DEBUG - logInfof "Trackingspan %A is being added." trackingSpan -#endif - - Grid.IsVisibleChanged - |> Event.filter (fun eventArgs -> eventArgs.NewValue :?> bool) - |> Event.add (createLensUIElement lens trackingSpan) - - for oldResult in oldResults do - let trackingSpan, _ = oldResult.Value - lensDisplayService.RemoveLens trackingSpan |> ignore -#if DEBUG - logInfof "Finished updating lens." -#endif - - if not firstTimeChecked then - firstTimeChecked <- true - } |> Async.Ignore - - do - begin - buffer.Changed.AddHandler(fun _ e -> (self.BufferChanged e)) - async { - let mutable numberOfFails = 0 - while not firstTimeChecked && numberOfFails < 10 do - try - do! executeLensAsync() - do! Async.Sleep(1000) - with - | e -> -#if DEBUG - logErrorf "Lens startup failed with: %A" e -#else - ignore e -#endif - numberOfFails <- numberOfFails + 1 - } |> Async.Start - end - - member _.BufferChanged ___ = - bufferChangedCts.Cancel() // Stop all ongoing async workflow. - bufferChangedCts.Dispose() - bufferChangedCts <- new CancellationTokenSource() - executeLensAsync () |> Async.Ignore |> RoslynHelpers.StartAsyncSafe bufferChangedCts.Token "Buffer Changed" diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs index 4ee2d142737..9e51ec9fb08 100644 --- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs +++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs @@ -72,16 +72,6 @@ type LanguageServicePerformanceOptions = EnableParallelCheckingWithSignatureFiles = false EnableParallelReferenceResolution = false } -[] -type LensOptions = - { Enabled : bool - UseColors: bool - Prefix : string } - static member Default = - { Enabled = false - UseColors = false - Prefix = "// " } - [] type AdvancedOptions = { IsBlockStructureEnabled: bool @@ -116,7 +106,6 @@ type EditorOptions store.Register LanguageServicePerformanceOptions.Default store.Register AdvancedOptions.Default store.Register IntelliSenseOptions.Default - store.Register LensOptions.Default store.Register FormattingOptions.Default member _.IntelliSense : IntelliSenseOptions = store.Get() @@ -124,7 +113,6 @@ type EditorOptions member _.CodeFixes : CodeFixesOptions = store.Get() member _.LanguageServicePerformance : LanguageServicePerformanceOptions = store.Get() member _.Advanced: AdvancedOptions = store.Get() - member _.Lens: LensOptions = store.Get() member _.Formatting : FormattingOptions = store.Get() interface Microsoft.CodeAnalysis.Host.IWorkspaceService @@ -175,12 +163,6 @@ module internal OptionsUI = override this.CreateView() = upcast LanguageServicePerformanceOptionControl() - [] - type internal LensOptionPage() = - inherit AbstractOptionPage() - override this.CreateView() = - upcast LensOptionControl() - [] type internal AdvancedSettingsOptionPage() = inherit AbstractOptionPage() diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf index 9bb3fc5afca..4db3fac1a02 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf @@ -242,11 +242,6 @@ Upřesnit - - Lens - Lens - - Formatting Formátování diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf index 78390902d29..9b2e783f971 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf @@ -242,11 +242,6 @@ Erweitert - - Lens - Lens - - Formatting Formatierung diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf index cf4755d3bd9..a9aea465647 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf @@ -242,11 +242,6 @@ Opciones avanzadas - - Lens - Lens - - Formatting Formato diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf index 2d217aba6b7..59d3d4e7177 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf @@ -242,11 +242,6 @@ Avancé - - Lens - Lens - - Formatting Mise en forme diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf index 0a8c84d563e..a915c0dbb09 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf @@ -242,11 +242,6 @@ Avanzate - - Lens - Lens - - Formatting Formattazione diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf index a42c056b86d..6f719cbc419 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf @@ -242,11 +242,6 @@ 詳細 - - Lens - Lens - - Formatting 書式設定 diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf index 6dfde115cc9..df9e6f4b81a 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf @@ -242,11 +242,6 @@ 고급 - - Lens - Lens - - Formatting 서식 diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf index 8d64b02e369..ed9c8cc2822 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf @@ -242,11 +242,6 @@ Zaawansowane - - Lens - Lens - - Formatting Formatowanie diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf index 1a5a76b6f9c..7433eb35d82 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf @@ -242,11 +242,6 @@ Avançado - - Lens - Lens - - Formatting Formatação diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf index 7192ce2bbd6..008fe677208 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf @@ -242,11 +242,6 @@ Дополнительный - - Lens - Lens - - Formatting Форматирование diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf index d6ac70f0d35..7c462930453 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf @@ -242,11 +242,6 @@ Gelişmiş - - Lens - Lens - - Formatting Biçimlendirme diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf index 8edc31ae980..93790c1fa8f 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf @@ -242,11 +242,6 @@ 高级 - - Lens - Lens - - Formatting 正在格式化 diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf index 568d86c92a1..9b05a5873a4 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf @@ -242,11 +242,6 @@ 進階 - - Lens - Lens - - Formatting 格式化 diff --git a/vsintegration/src/FSharp.UIResources/LensOptionControl.xaml b/vsintegration/src/FSharp.UIResources/LensOptionControl.xaml deleted file mode 100644 index 8d5b2d6e199..00000000000 --- a/vsintegration/src/FSharp.UIResources/LensOptionControl.xaml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vsintegration/src/FSharp.UIResources/LensOptionControl.xaml.cs b/vsintegration/src/FSharp.UIResources/LensOptionControl.xaml.cs deleted file mode 100644 index 5ae19bbb75f..00000000000 --- a/vsintegration/src/FSharp.UIResources/LensOptionControl.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace Microsoft.VisualStudio.FSharp.UIResources -{ - /// - /// Interaction logic for LensOptionPage.xaml - /// - internal partial class LensOptionControl : UserControl - { - public LensOptionControl() - { - InitializeComponent(); - } - } -} diff --git a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs index c2c44bfb4a7..dad1be8b346 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs +++ b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs @@ -231,42 +231,6 @@ public static string Language_Service_Performance { } } - /// - /// Looks up a localized string similar to Lens. - /// - public static string Lens { - get { - return ResourceManager.GetString("Lens", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Annotation prefix. - /// - public static string Lens_Prefix { - get { - return ResourceManager.GetString("Lens_Prefix", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enable Lens (Experimental). - /// - public static string Lens_Switch { - get { - return ResourceManager.GetString("Lens_Switch", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Use colors in annotations. - /// - public static string Lens_UseColors { - get { - return ResourceManager.GetString("Lens_UseColors", resourceCulture); - } - } - /// /// Looks up a localized string similar to Navigation links. /// diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx index f87b2edd988..d48c9526702 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.resx +++ b/vsintegration/src/FSharp.UIResources/Strings.resx @@ -120,18 +120,6 @@ Always place open statements at the top level - - Lens - - - Enable Lens (Experimental) - - - Annotation prefix - - - Use colors in annotations - Code Fixes diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index d50c7ea6d1c..14a5be50a2b 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -12,26 +12,6 @@ Inline Hints - - Lens - Lens - - - - Enable Lens (Experimental) - Povolit funkci Lens (experimentální) - - - - Annotation prefix - Předpona poznámky - - - - Use colors in annotations - Použít barvy v poznámkách - - Code Fixes Opravy kódu diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index d4d347fbc81..c54b2953101 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -12,26 +12,6 @@ Inline Hints - - Lens - Lens - - - - Enable Lens (Experimental) - Lens aktivieren (experimentell) - - - - Annotation prefix - Anmerkungspräfix - - - - Use colors in annotations - Farben in Anmerkungen verwenden - - Code Fixes Codefehlerbehebungen diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index 2591eae9f36..a36a5e67414 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -12,26 +12,6 @@ Inline Hints - - Lens - Lens - - - - Enable Lens (Experimental) - Habilitar Lens (experimental) - - - - Annotation prefix - Prefijo de anotación - - - - Use colors in annotations - Usar colores en anotaciones - - Code Fixes Correcciones de código diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index 8f7821d9aeb..6f4222e5d34 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -12,26 +12,6 @@ Inline Hints - - Lens - Lens - - - - Enable Lens (Experimental) - Activer Lens (expérimental) - - - - Annotation prefix - Préfixe d'annotation - - - - Use colors in annotations - Utiliser des couleurs dans les annotations - - Code Fixes Correctifs du code diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index 447da25a467..6506e23873e 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -12,26 +12,6 @@ Inline Hints - - Lens - Lens - - - - Enable Lens (Experimental) - Abilita Lens (sperimentale) - - - - Annotation prefix - Prefisso annotazione - - - - Use colors in annotations - Usa colori nelle annotazioni - - Code Fixes Correzioni del codice diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index a2f3594e548..2bb8b5643d3 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -12,26 +12,6 @@ Inline Hints - - Lens - Lens - - - - Enable Lens (Experimental) - Lens を有効にする (試験段階) - - - - Annotation prefix - 注釈のプレフィックス - - - - Use colors in annotations - 注釈でカラーを使用する - - Code Fixes コード修正 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index e03949a0ba5..feae9fa0368 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -12,26 +12,6 @@ Inline Hints - - Lens - Lens - - - - Enable Lens (Experimental) - Lens 사용(실험적) - - - - Annotation prefix - 주석 접두사 - - - - Use colors in annotations - 주석에서 색 사용 - - Code Fixes 코드 수정 사항 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index 71e9dbf228b..9e1bb90b30e 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -12,26 +12,6 @@ Inline Hints - - Lens - Lens - - - - Enable Lens (Experimental) - Włącz funkcję Lens (eksperymentalna) - - - - Annotation prefix - Prefiks adnotacji - - - - Use colors in annotations - Stosuj kolory w adnotacjach - - Code Fixes Poprawki kodu diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index 96ec77b97f2..32ed3a2e34b 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -12,26 +12,6 @@ Inline Hints - - Lens - Lens - - - - Enable Lens (Experimental) - Habilitar Lens (Experimental) - - - - Annotation prefix - Prefixo da anotação - - - - Use colors in annotations - Usar cores em anotações - - Code Fixes Correções de Código diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index 7e45d8e8d23..459db8c25f2 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -12,26 +12,6 @@ Inline Hints - - Lens - Lens - - - - Enable Lens (Experimental) - Включить Lens (экспериментальная функция) - - - - Annotation prefix - Префикс примечания - - - - Use colors in annotations - Использовать цветные примечания - - Code Fixes Исправления кода diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index c05d626e70a..47a2bcd6e03 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -12,26 +12,6 @@ Inline Hints - - Lens - Lens - - - - Enable Lens (Experimental) - Lens’i Etkinleştir (Deneysel) - - - - Annotation prefix - Ek açıklama ön eki - - - - Use colors in annotations - Ek açıklamalarda renk kullan - - Code Fixes Kod Düzeltmeleri diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index abe99a445cd..5c03fc08051 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -12,26 +12,6 @@ Inline Hints - - Lens - Lens - - - - Enable Lens (Experimental) - 启用 Lens (试验) - - - - Annotation prefix - 批注前缀 - - - - Use colors in annotations - 在批注中使用颜色 - - Code Fixes 代码修补程序 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index 4e5a0bacc5a..008f0ac1995 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -12,26 +12,6 @@ Inline Hints - - Lens - Lens - - - - Enable Lens (Experimental) - 啟用 Lens (實驗性) - - - - Annotation prefix - 註釋前置詞 - - - - Use colors in annotations - 在註釋中使用色彩 - - Code Fixes 程式碼修正 From ef39f3c71393af2a1782b24accd91389ec16bd7f Mon Sep 17 00:00:00 2001 From: Petr Date: Mon, 7 Nov 2022 17:06:40 +0100 Subject: [PATCH 3/3] Revert "Bunch of crap that hinders my work" This reverts commit 4d860b92754cf65155dad4eee606c371af346fd6. --- tests/fsharp/FSharpSuite.Tests.fsproj | 1 + tests/fsharp/TypeProviderTests.fs | 391 ++++++++++++++++++ .../src/FSharp.LanguageService.Base/Source.cs | 2 +- .../FSharp.LanguageService.Base/ViewFilter.cs | 8 +- .../ArtificalEventInfo.cs | 1 + .../ArtificialConstructorInfo.cs | 1 + .../ArtificialMethodInfo.cs | 2 +- .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 2 +- .../TypeProviderInCSharp.cs | 9 +- .../ArtificalEventInfo.cs | 2 +- .../ArtificialConstructorInfo.cs | 2 +- .../ArtificialMethodInfo.cs | 1 + .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 2 +- .../TypeProviderInCSharp.cs | 4 +- .../ArtificalEventInfo.cs | 2 +- .../ArtificialConstructorInfo.cs | 1 + .../ArtificialMethodInfo.cs | 1 + .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 2 +- .../TypeProviderInCSharp.cs | 4 +- .../ArtificalEventInfo.cs | 1 + .../ArtificialConstructorInfo.cs | 2 +- .../ArtificialMethodInfo.cs | 2 +- .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 2 +- .../TypeProviderInCSharp.cs | 4 +- .../ArtificalEventInfo.cs | 2 +- .../ArtificialConstructorInfo.cs | 2 +- .../ArtificialMethodInfo.cs | 2 +- .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 1 + .../TypeProviderInCSharp.cs | 4 +- .../tests/MockTypeProviders/Helpers.cs | 15 +- .../ArtificalEventInfo.cs | 2 +- .../ArtificialConstructorInfo.cs | 2 +- .../ArtificialMethodInfo.cs | 2 +- .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 1 + .../TypeProviderInCSharp.cs | 4 +- .../ArtificalEventInfo.cs | 1 + .../ArtificialConstructorInfo.cs | 1 + .../ArtificialMethodInfo.cs | 1 + .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 1 + .../TypeProviderInCSharp.cs | 4 +- .../ArtificalEventInfo.cs | 1 + .../ArtificialConstructorInfo.cs | 1 + .../ArtificialMethodInfo.cs | 1 + .../ArtificialPropertyInfo.cs | 1 + .../ArtificialType.cs | 2 +- .../TypeProviderInCSharp.cs | 4 +- .../ArtificalEventInfo.cs | 2 +- .../ArtificialConstructorInfo.cs | 2 +- .../ArtificialMethodInfo.cs | 2 +- .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 2 +- .../TypeProviderInCSharp.cs | 4 +- .../ArtificalEventInfo.cs | 2 +- .../ArtificialConstructorInfo.cs | 2 +- .../ArtificialMethodInfo.cs | 2 +- .../ArtificialPropertyInfo.cs | 2 +- .../ArtificialType.cs | 2 +- .../TypeProviderInCSharp.cs | 4 +- .../UnitTests/VisualFSharp.UnitTests.fsproj | 12 + 66 files changed, 500 insertions(+), 58 deletions(-) create mode 100644 tests/fsharp/TypeProviderTests.fs diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index 9d74370a589..2ef59aaec06 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -23,6 +23,7 @@ + diff --git a/tests/fsharp/TypeProviderTests.fs b/tests/fsharp/TypeProviderTests.fs new file mode 100644 index 00000000000..fa56bbcc99c --- /dev/null +++ b/tests/fsharp/TypeProviderTests.fs @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +#if INTERACTIVE +//#r @"../../release/net40/bin/FSharp.Compiler.dll" +#r @"../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" +#load "../../src/scripts/scriptlib.fsx" +#load "../FSharp.Test.Utilities/TestFramework.fs" +#load "single-test.fs" +#else +[] +module FSharp.Test.FSharpSuite.TypeProviderTests +#endif + +open System +open System.IO +open System.Reflection +open NUnit.Framework +open TestFramework +open Scripting +open SingleTest + +open FSharp.Compiler.IO + +#if !NETCOREAPP +// All tests which do a manual invoke of the F# compiler are disabled + +#if NETCOREAPP +// Use these lines if you want to test CoreCLR +let FSC_OPTIMIZED = FSC_NETCORE (true, false) +let FSI = FSI_NETCORE +#else +let FSC_OPTIMIZED = FSC_NETFX (true, false) +let FSI = FSI_NETFX +#endif + +let inline getTestsDirectory dir = getTestsDirectory __SOURCE_DIRECTORY__ dir +let testConfig = getTestsDirectory >> testConfig + +[] +let diamondAssembly () = + let cfg = testConfig "typeProviders/diamondAssembly" + + rm cfg "provider.dll" + + // Add a version flag to make this generate native resources. The native resources aren't important and + // can be dropped when the provided.dll is linked but we need to tolerate generated DLLs that have them + fsc cfg "%s" "--out:provided.dll -a --version:0.0.0.1" [".." ++ "helloWorld" ++ "provided.fs"] + + fsc cfg "%s" "--out:provider.dll -a" [".." ++ "helloWorld" ++ "provider.fsx"] + + fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test1.dll -a" cfg.fsc_flags ["test1.fsx"] + + fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test2a.dll -a -r:test1.dll" cfg.fsc_flags ["test2a.fsx"] + + fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test2b.dll -a -r:test1.dll" cfg.fsc_flags ["test2b.fsx"] + + fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test3.exe -r:test1.dll -r:test2a.dll -r:test2b.dll" cfg.fsc_flags ["test3.fsx"] + + peverify cfg "test1.dll" + + peverify cfg "test2a.dll" + + peverify cfg "test2b.dll" + + peverify cfg "test3.exe" + + exec cfg ("." ++ "test3.exe") "" + + use testOkFile = fileguard cfg "test.ok" + + fsi cfg "%s" cfg.fsi_flags ["test3.fsx"] + + testOkFile.CheckExists() + +[] +let globalNamespace () = + let cfg = testConfig "typeProviders/globalNamespace" + + csc cfg """/out:globalNamespaceTP.dll /debug+ /target:library /r:netstandard.dll /r:"%s" """ cfg.FSCOREDLLPATH ["globalNamespaceTP.cs"] + + fsc cfg "%s /debug+ /r:globalNamespaceTP.dll /optimize-" cfg.fsc_flags ["test.fsx"] + +let helloWorld p = + let cfg = testConfig "typeProviders/helloWorld" + + fsc cfg "%s" "--out:provided1.dll -g -a" [".." ++ "helloWorld" ++ "provided.fs"] + + fsc cfg "%s" "--out:provided2.dll -g -a" [".." ++ "helloWorld" ++ "provided.fs"] + + fsc cfg "%s" "--out:provided3.dll -g -a" [".." ++ "helloWorld" ++ "provided.fs"] + + fsc cfg "%s" "--out:provided4.dll -g -a" [".." ++ "helloWorld" ++ "provided.fs"] + + fsc cfg "%s" "--out:providedJ.dll -g -a" [".." ++ "helloWorld" ++ "providedJ.fs"] + + fsc cfg "%s" "--out:providedK.dll -g -a" [".." ++ "helloWorld" ++ "providedK.fs"] + + fsc cfg "%s" "--out:providedNullAssemblyName.dll -g -a" [".." ++ "helloWorld" ++ "providedNullAssemblyName.fsx"] + + fsc cfg "--out:provided.dll -a" [".." ++ "helloWorld" ++ "provided.fs"] + + fsc cfg "--out:providedJ.dll -a" [".." ++ "helloWorld" ++ "providedJ.fs"] + + fsc cfg "--out:providedK.dll -a" [".." ++ "helloWorld" ++ "providedK.fs"] + + fsc cfg "--out:provider.dll -a" ["provider.fsx"] + + SingleTest.singleTestBuildAndRunAux cfg p + + + rm cfg "provider_with_binary_compat_changes.dll" + + mkdir cfg "bincompat1" + + log "pushd bincompat1" + let bincompat1 = getfullpath cfg "bincompat1" + + Directory.EnumerateFiles(bincompat1 ++ "..", "*.dll") + |> Seq.iter (fun from -> Commands.copy bincompat1 from ("." ++ Path.GetFileName(from)) |> ignore) + + fscIn cfg bincompat1 "%s" "-g -a -o:test_lib.dll -r:provider.dll" [".." ++ "test.fsx"] + + fscIn cfg bincompat1 "%s" "-r:test_lib.dll -r:provider.dll" [".." ++ "testlib_client.fsx"] + + log "popd" + + mkdir cfg "bincompat2" + + log "pushd bincompat2" + let bincompat2 = getfullpath cfg "bincompat2" + + for fromFile in Directory.EnumerateFiles(bincompat2 ++ ".." ++ "bincompat1", "*.dll") do + Commands.copy bincompat2 fromFile ("." ++ Path.GetFileName(fromFile)) |> ignore + + fscIn cfg bincompat2 "%s" "--define:ADD_AN_OPTIONAL_STATIC_PARAMETER --define:USE_IMPLICIT_ITypeProvider2 --out:provider.dll -g -a" [".." ++ "provider.fsx"] + + fscIn cfg bincompat2 "-g -a -o:test_lib_recompiled.dll -r:provider.dll" [".." ++ "test.fsx"] + + fscIn cfg bincompat2 "%s" "--define:ADD_AN_OPTIONAL_STATIC_PARAMETER -r:test_lib.dll -r:provider.dll" [".." ++ "testlib_client.fsx"] + + peverify cfg (bincompat2 ++ "provider.dll") + + peverify cfg (bincompat2 ++ "test_lib.dll") + + peverify cfg (bincompat2 ++ "test_lib_recompiled.dll") + + peverify cfg (bincompat2 ++ "testlib_client.exe") + +[] +let ``helloWorld fsc`` () = helloWorld FSC_OPTIMIZED + +#if !NETCOREAPP +[] +let ``helloWorld fsi`` () = helloWorld FSI_NETFX_STDIN +#endif + +[] +let helloWorldCSharp () = + let cfg = testConfig "typeProviders/helloWorldCSharp" + + rm cfg "magic.dll" + + fsc cfg "%s" "--out:magic.dll -a --keyfile:magic.snk" ["magic.fs "] + + rm cfg "provider.dll" + + csc cfg """/out:provider.dll /target:library "/r:%s" /r:netstandard.dll /r:magic.dll""" cfg.FSCOREDLLPATH ["provider.cs"] + + fsc cfg "%s /debug+ /r:provider.dll /optimize-" cfg.fsc_flags ["test.fsx"] + + peverify cfg "magic.dll" + + peverify cfg "provider.dll" + + peverify cfg "test.exe" + + exec cfg ("." ++ "test.exe") "" + + +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +[] +let ``negative type provider tests`` (name:string) = + let cfg = testConfig "typeProviders/negTests" + let dir = cfg.Directory + + if requireENCulture () then + + let fileExists = Commands.fileExists dir >> Option.isSome + + rm cfg "provided.dll" + + fsc cfg "--out:provided.dll -a" [".." ++ "helloWorld" ++ "provided.fs"] + + rm cfg "providedJ.dll" + + fsc cfg "--out:providedJ.dll -a" [".." ++ "helloWorld" ++ "providedJ.fs"] + + rm cfg "providedK.dll" + + fsc cfg "--out:providedK.dll -a" [".." ++ "helloWorld" ++ "providedK.fs"] + + rm cfg "provider.dll" + + fsc cfg "--out:provider.dll -g --optimize- -a" ["provider.fsx"] + + fsc cfg "--out:provider_providerAttributeErrorConsume.dll -a" ["providerAttributeError.fsx"] + + fsc cfg "--out:provider_ProviderAttribute_EmptyConsume.dll -a" ["providerAttribute_Empty.fsx"] + + rm cfg "helloWorldProvider.dll" + + fsc cfg "--out:helloWorldProvider.dll -g --optimize- -a" [".." ++ "helloWorld" ++ "provider.fsx"] + + rm cfg "MostBasicProvider.dll" + + fsc cfg "--out:MostBasicProvider.dll -g --optimize- -a" ["MostBasicProvider.fsx"] + + let preprocess name pref = + let dirp = (dir |> Commands.pathAddBackslash) + do + FileSystem.OpenFileForReadShim(sprintf "%s%s.%sbslpp" dirp name pref) + .ReadAllText() + .Replace("", getfullpath cfg (sprintf "provider_%s.dll" name)) + .Replace("",dirp) + .Replace("",sprintf "file:///%s" dirp) + |> fun txt -> FileSystem.OpenFileForWriteShim(sprintf "%s%s.%sbsl" dirp name pref).Write(txt) + + if name = "ProviderAttribute_EmptyConsume" || name = "providerAttributeErrorConsume" then () + else fsc cfg "--define:%s --out:provider_%s.dll -a" name name ["provider.fsx"] + + if fileExists (sprintf "%s.bslpp" name) then preprocess name "" + + if fileExists (sprintf "%s.vsbslpp" name) then preprocess name "vs" + + SingleTest.singleNegTest cfg name + +let splitAssembly subdir project = + let subdir = getTestsDirectory subdir + let cfg = testConfig project + + let clean() = + rm cfg "providerDesigner.dll" + rmdir cfg "typeproviders" + rmdir cfg "tools" + rmdir cfg (".." ++ "typeproviders") + rmdir cfg (".." ++ "tools") + + clean() + + fsc cfg "--out:provider.dll -a" ["provider.fs"] + + fsc cfg "--out:providerDesigner.dll -a" ["providerDesigner.fsx"] + + fsc cfg "--out:test.exe -r:provider.dll" ["test.fsx"] + + begin + use testOkFile = fileguard cfg "test.ok" + + exec cfg ("." ++ "test.exe") "" + + testOkFile.CheckExists() + end + + begin + use testOkFile = fileguard cfg "test.ok" + + fsi cfg "%s" cfg.fsi_flags ["test.fsx"] + testOkFile.CheckExists() + end + + // Do the same thing with different load locations for the type provider design-time component + + clean() + + // check a few load locations + let someLoadPaths = + [ subdir ++ "fsharp41" ++ "net48" + subdir ++ "fsharp41" ++ "net472" + subdir ++ "fsharp41" ++ "net461" + subdir ++ "fsharp41" ++ "net45" + // include up one directory + ".." ++ subdir ++ "fsharp41" ++ "net45" + subdir ++ "fsharp41" ++ "netstandard2.0" ] + + for dir in someLoadPaths do + + printfn "" + printfn "Checking load path '%s'" dir + clean() + + // put providerDesigner.dll into a different place + mkdir cfg dir + fsc cfg "--out:%s/providerDesigner.dll -a" dir ["providerDesigner.fsx"] + + fsc cfg "--out:test.exe -r:provider.dll" ["test.fsx"] + + begin + use testOkFile = fileguard cfg "test.ok" + + exec cfg ("." ++ "test.exe") "" + + testOkFile.CheckExists() + end + + begin + use testOkFile = fileguard cfg "test.ok" + + fsi cfg "%s" cfg.fsi_flags ["test.fsx"] + testOkFile.CheckExists() + end + + clean() + +[] +let splitAssemblyTools () = splitAssembly "tools" "typeProviders/splitAssemblyTools" + +[] +let splitAssemblyTypeProviders () = splitAssembly "typeproviders" "typeProviders/splitAssemblyTypeproviders" + +[] +let wedgeAssembly () = + let cfg = testConfig "typeProviders/wedgeAssembly" + + rm cfg "provider.dll" + + rm cfg "provided.dll" + + fsc cfg "%s" "--out:provided.dll -a" [".." ++ "helloWorld" ++ "provided.fs"] + + rm cfg "providedJ.dll" + + fsc cfg "%s" "--out:providedJ.dll -a" [".." ++ "helloWorld" ++ "providedJ.fs"] + + rm cfg "providedK.dll" + + fsc cfg "%s" "--out:providedK.dll -a" [".." ++ "helloWorld" ++ "providedK.fs"] + + fsc cfg "%s" "--out:provider.dll -a" [".." ++ "helloWorld" ++ "provider.fsx"] + + fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test2a.dll -a" cfg.fsc_flags ["test2a.fs"] + + fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test2b.dll -a" cfg.fsc_flags ["test2b.fs"] + + fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test3.exe" cfg.fsc_flags ["test3.fsx"] + + fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test2a-with-sig.dll -a" cfg.fsc_flags ["test2a.fsi"; "test2a.fs"] + + fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test2b-with-sig.dll -a" cfg.fsc_flags ["test2b.fsi"; "test2b.fs"] + + fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test3-with-sig.exe --define:SIGS" cfg.fsc_flags ["test3.fsx"] + + fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test2a-with-sig-restricted.dll -a" cfg.fsc_flags ["test2a-restricted.fsi"; "test2a.fs"] + + fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test2b-with-sig-restricted.dll -a"cfg.fsc_flags ["test2b-restricted.fsi"; "test2b.fs"] + + fsc cfg "%s --debug+ -r:provider.dll --optimize- -o:test3-with-sig-restricted.exe --define:SIGS_RESTRICTED" cfg.fsc_flags ["test3.fsx"] + + peverify cfg "test2a.dll" + + peverify cfg "test2b.dll" + + peverify cfg "test3.exe" + + exec cfg ("." ++ "test3.exe") "" +#endif diff --git a/vsintegration/src/FSharp.LanguageService.Base/Source.cs b/vsintegration/src/FSharp.LanguageService.Base/Source.cs index cd8a04a6858..10f9d2ef9cf 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/Source.cs +++ b/vsintegration/src/FSharp.LanguageService.Base/Source.cs @@ -1243,7 +1243,7 @@ private void HandleMethodTipResponse(BackgroundRequest_DEPRECATED req) Microsoft.FSharp.Core.FSharpOption methodsOpt = req.ResultIntellisenseInfo.GetMethodListForAMethodTip(); if (methodsOpt != null) { - MethodListForAMethodTip_DEPRECATED methods = null; + MethodListForAMethodTip_DEPRECATED methods = methodsOpt.Value; if (methods != null) { diff --git a/vsintegration/src/FSharp.LanguageService.Base/ViewFilter.cs b/vsintegration/src/FSharp.LanguageService.Base/ViewFilter.cs index 22c19ee957d..5026bc3d022 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/ViewFilter.cs +++ b/vsintegration/src/FSharp.LanguageService.Base/ViewFilter.cs @@ -418,7 +418,10 @@ protected virtual int QueryCommandStatus(ref Guid guidCmdGroup, uint nCmdId) { var dbgState = Interactive.Hooks.GetDebuggerState(GetProjectSystemPackage()); - return (int)OLECMDF.OLECMDF_SUPPORTED | (int)OLECMDF.OLECMDF_ENABLED; + if (dbgState == Interactive.FsiDebuggerState.AttachedNotToFSI) + return (int)OLECMDF.OLECMDF_INVISIBLE; + else + return (int)OLECMDF.OLECMDF_SUPPORTED | (int)OLECMDF.OLECMDF_ENABLED; } } @@ -540,10 +543,12 @@ public virtual bool HandlePreExec(ref Guid guidCmdGroup, uint nCmdId, uint nCmde { if (nCmdId == (uint) Microsoft.VisualStudio.VSConstants.VSStd11CmdID.ExecuteSelectionInInteractive) { + Interactive.Hooks.OnMLSend(GetProjectSystemPackage(), Interactive.FsiEditorSendAction.ExecuteSelection, null, null); return true; } else if (nCmdId == (uint) Microsoft.VisualStudio.VSConstants.VSStd11CmdID.ExecuteLineInInteractive) { + Interactive.Hooks.OnMLSend(GetProjectSystemPackage(), Interactive.FsiEditorSendAction.ExecuteLine, null, null); return true; } } @@ -551,6 +556,7 @@ public virtual bool HandlePreExec(ref Guid guidCmdGroup, uint nCmdId, uint nCmde { if (nCmdId == cmdIDDebugSelection) { + Interactive.Hooks.OnMLSend(GetProjectSystemPackage(), Interactive.FsiEditorSendAction.DebugSelection, null, null); return true; } } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs index a8db176ee0f..47b62e52323 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs @@ -112,6 +112,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *event* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 4 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs index a72c58214ba..2583ed77293 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs @@ -116,6 +116,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic .ctor created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs index 8a4a52409c5..b97a3fe9f83 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs @@ -143,7 +143,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic *method* created by me!!"))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs index 87caf376f56..ced1148fc89 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs @@ -157,7 +157,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *property* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs index 5c5e6e01c1c..e415c1fa7d0 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs @@ -734,7 +734,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic type created by me!"))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs index 187f1bbf05f..43ba4cb1b8a 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 + class Namespace1 : IProvidedNamespace { const string _Namespace = "N"; const string _Name = "T"; @@ -45,6 +45,11 @@ public Type[] GetTypes() return new Type[] { myType }; } + public string NamespaceName + { + get { return _Namespace; } + } + public Type ResolveTypeName(string typeName) { @@ -129,7 +134,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { }; + return new IProvidedNamespace[] { new Namespace1() }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs index 4fe76358a5c..0e56fd91093 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs @@ -121,7 +121,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *event* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "Temp.fs", Line = 4 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs index 6df0e0f9713..9604075024e 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs @@ -126,7 +126,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic .ctor created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "Temp.fs", Line = 3 })); // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs index 41a3bcda86d..cb8bfb2d33a 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs @@ -159,6 +159,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic *method* created by me!!"))); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5, FilePath = "Temp.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs index 6839190f978..8dabf72a4f6 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs @@ -172,7 +172,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *property* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "Temp.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs index 2b8581c8ea2..0cd77683ea6 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs @@ -759,7 +759,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic type created by me!"))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "Temp.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs index 1e22a8b5002..ecc8412763e 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 + class Namespace1 : IProvidedNamespace { const string _Namespace = "N"; const string _Name = "T"; @@ -134,7 +134,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { }; + return new IProvidedNamespace[] { new Namespace1() }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs index 5e9b20d0298..7af2e04d731 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs @@ -121,7 +121,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *event* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 50 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs index 5643b32a229..98e95ba9b74 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs @@ -126,6 +126,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic .ctor created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 50 })); // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs index 41a3bcda86d..0e49d34733a 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs @@ -159,6 +159,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic *method* created by me!!"))); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 50 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs index 8d602e092c6..8dc308a1f6a 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs @@ -172,7 +172,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *property* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 50 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs index bf5b584d8c6..2ee8878a0de 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs @@ -761,7 +761,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic type created by me!"))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 50 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs index 973a4ec3a9e..9b56e850af8 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 + class Namespace1 : IProvidedNamespace { const string _Namespace = "N"; const string _Name = "T"; @@ -124,7 +124,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { }; + return new IProvidedNamespace[] { new Namespace1() }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs index 45630bcb391..73b0e81caa1 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs @@ -122,6 +122,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *event* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 4 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs index 6df0e0f9713..e4e2aec87d9 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs @@ -126,7 +126,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic .ctor created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs index 601c9401c27..94c749ef776 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs @@ -159,7 +159,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic *method* created by me!!"))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs index 8d602e092c6..55c379ee910 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs @@ -172,7 +172,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *property* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs index bf5b584d8c6..516eb47d9f6 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs @@ -761,7 +761,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic type created by me!"))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs index a3b0960fcde..89ea8bcda71 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 + class Namespace1 : IProvidedNamespace { const string _Namespace = "N"; const string _Name = "T T"; @@ -125,7 +125,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { }; + return new IProvidedNamespace[] { new Namespace1() }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs index 4fe76358a5c..bd299a9dc6b 100644 --- a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs @@ -121,7 +121,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *event* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs index ddc85511119..098489fa892 100644 --- a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs @@ -126,7 +126,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic .ctor created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); //attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs index 601c9401c27..94c749ef776 100644 --- a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs @@ -159,7 +159,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic *method* created by me!!"))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs index 204cf982574..febe6dd26b0 100644 --- a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs @@ -171,7 +171,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *property* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs index 78f9cd8171d..3b47724351a 100644 --- a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs @@ -759,6 +759,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic type created by me!"))); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs index 1e22a8b5002..ecc8412763e 100644 --- a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 + class Namespace1 : IProvidedNamespace { const string _Namespace = "N"; const string _Name = "T"; @@ -134,7 +134,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { }; + return new IProvidedNamespace[] { new Namespace1() }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/Helpers.cs b/vsintegration/tests/MockTypeProviders/Helpers.cs index 0a03dbc5c98..9a2dec4ffba 100644 --- a/vsintegration/tests/MockTypeProviders/Helpers.cs +++ b/vsintegration/tests/MockTypeProviders/Helpers.cs @@ -30,7 +30,10 @@ public override IList ConstructorArguments { get { - return new List(); + if (_a is TypeProviderXmlDocAttribute) + return new List() { new CustomAttributeTypedArgument(typeof(string), ((TypeProviderXmlDocAttribute)_a).CommentText) }; + else // if (_a is TypeProviderDefinitionLocationAttribute || _a is TypeProviderEditorHideMethodsAttribute) + return new List(); } } @@ -38,7 +41,15 @@ public override IList NamedArguments { get { - return new List(); + if (_a is TypeProviderDefinitionLocationAttribute) + { + var t = _a.GetType(); + return new List() { new CustomAttributeNamedArgument(t.GetProperty("Column"), ((TypeProviderDefinitionLocationAttribute)_a).Column), + new CustomAttributeNamedArgument(t.GetProperty("FilePath"), ((TypeProviderDefinitionLocationAttribute)_a).FilePath), + new CustomAttributeNamedArgument(t.GetProperty("Line"), ((TypeProviderDefinitionLocationAttribute)_a).Line) }; + } + else // if (_a is TypeProviderXmlDocAttribute || _a is TypeProviderEditorHideMethodsAttribute) + return new List(); } } } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs index 4fe76358a5c..bd299a9dc6b 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs @@ -121,7 +121,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *event* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs index 6df0e0f9713..e4e2aec87d9 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs @@ -126,7 +126,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic .ctor created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs index 601c9401c27..94c749ef776 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs @@ -159,7 +159,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic *method* created by me!!"))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs index 8d602e092c6..55c379ee910 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs @@ -172,7 +172,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *property* created by me for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs index 222a2896eec..57511e107c1 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs @@ -759,6 +759,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic type created by me!"))); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs index 1e22a8b5002..ecc8412763e 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 + class Namespace1 : IProvidedNamespace { const string _Namespace = "N"; const string _Name = "T"; @@ -134,7 +134,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { }; + return new IProvidedNamespace[] { new Namespace1() }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs index 9d285fae7f5..f3cf9213763 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs @@ -121,6 +121,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("")))); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5 + this._DeclaringType.Name.Length, FilePath = "", Line = 3 })); // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs index 8aa3a587043..5dafdd58c89 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs @@ -126,6 +126,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("")))); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5 + this._DeclaringType.Name.Length, FilePath = "", Line = 3 })); // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs index aa90d5140c0..416cfb3a58b 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs @@ -159,6 +159,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("")))); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 22 + this._DeclaringType.Name.Length, FilePath = "", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs index 3c5ae0ede8e..4dac2014d83 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs @@ -172,7 +172,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(""))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs index 131dc5f6178..3afabaa1251 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs @@ -759,6 +759,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(""))); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs index 1e22a8b5002..ecc8412763e 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 + class Namespace1 : IProvidedNamespace { const string _Namespace = "N"; const string _Name = "T"; @@ -134,7 +134,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { }; + return new IProvidedNamespace[] { new Namespace1() }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs index 19d174f2aff..3489764df65 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs @@ -121,6 +121,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *event* Localized! ኤፍ ሻርፕ for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs index 2b857bb7a3d..2c61838f44f 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs @@ -126,6 +126,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic .ctor Localized! ኤፍ ሻርፕ for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5, FilePath = "File.fs", Line = 3 })); // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs index 86f6d9db576..396fbf47239 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs @@ -159,6 +159,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic *method* Localized! ኤፍ ሻርፕ"))); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs index 7e25a496856..4f6a6f739db 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs @@ -171,6 +171,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *property* Localized! ኤፍ ሻርፕ for {0}.{1}", this._DeclaringType.Namespace, this._DeclaringType.Name)))); + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 5, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs index f54a510fb0c..17209ccd5db 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs @@ -759,7 +759,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic type Localized! ኤፍ ሻርፕ"))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs index 1e22a8b5002..ecc8412763e 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 + class Namespace1 : IProvidedNamespace { const string _Namespace = "N"; const string _Name = "T"; @@ -134,7 +134,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { }; + return new IProvidedNamespace[] { new Namespace1() }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs index f2813586507..54fefab2f06 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs @@ -121,7 +121,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *event* created by me for {0}.{1}. Which is used to test the tool tip of the typeprovider Event to check if it shows the right message or not.!", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs index f6aca5a3ce9..1c2469f0cdc 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs @@ -126,7 +126,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic .ctor created by me for {0}.{1}. Which is used to test the tool tip of the typeprovider Constructor to check if it shows the right message or not.!", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs index 07fa251f2ad..58eca203318 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs @@ -159,7 +159,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic *method* created by me!!. Which is used to test the tool tip of the typeprovider Method to check if it shows the right message or not.!"))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs index b8b6b1ee17e..7ecc6299e7b 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs @@ -172,7 +172,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(string.Format("This is a synthetic *property* created by me for {0}.{1}. Which is used to test the tool tip of the typeprovider Property to check if it shows the right message or not.!", this._DeclaringType.Namespace, this._DeclaringType.Name)))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs index 5161c46c188..34e1a237518 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs @@ -759,7 +759,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute("This is a synthetic type created by me!. Which is used to test the tool tip of the typeprovider type to check if it shows the right message or not."))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs index 1e22a8b5002..ecc8412763e 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 + class Namespace1 : IProvidedNamespace { const string _Namespace = "N"; const string _Name = "T"; @@ -134,7 +134,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { }; + return new IProvidedNamespace[] { new Namespace1() }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs index 3f14efa9449..8fc82a30b1d 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs @@ -121,7 +121,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(null))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs index 03b07875898..0e04a726dd8 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs @@ -126,7 +126,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(null))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); // attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs index f7e1a443165..a292de169cd 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs @@ -159,7 +159,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(null))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs index e690fc6e573..16cef078863 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs @@ -171,7 +171,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(null))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs index b89e6ede322..1e4299b08f2 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs @@ -759,7 +759,7 @@ public override IList GetCustomAttributesData() { var attrs = new List(); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderXmlDocAttribute(null))); - + attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderDefinitionLocationAttribute() { Column = 21, FilePath = "File.fs", Line = 3 })); attrs.Add(new Helpers.TypeProviderCustomAttributeData(new TypeProviderEditorHideMethodsAttribute())); return attrs; } diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs index f2858a69729..dd7025bf9ed 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs @@ -25,7 +25,7 @@ namespace TypeProviderInCSharp // } //} - class Namespace1 + class Namespace1 : IProvidedNamespace { const string _Namespace = "N"; const string _Name = "T"; @@ -134,7 +134,7 @@ public FSharpExpr GetInvokerExpression(System.Reflection.MethodBase syntheticMet public IProvidedNamespace[] GetNamespaces() { - return new IProvidedNamespace[] { }; + return new IProvidedNamespace[] { new Namespace1() }; } public System.Reflection.ParameterInfo[] GetStaticParameters(Type typeWithoutArguments) diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 51d4b9aee64..6889c747714 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -148,6 +148,18 @@ + + + + + + + + + + + +