From 6796ead80ead6547daad2744cb231d06bfbbcfa6 Mon Sep 17 00:00:00 2001 From: dsyme Date: Sun, 27 Nov 2016 11:17:22 +0000 Subject: [PATCH] test param info for type provider named arguments --- .../unittests/SignatureHelpProviderTests.fs | 65 +++++++++++++++++-- 1 file changed, 59 insertions(+), 6 deletions(-) diff --git a/vsintegration/tests/unittests/SignatureHelpProviderTests.fs b/vsintegration/tests/unittests/SignatureHelpProviderTests.fs index dd6118f505a..bf000714832 100644 --- a/vsintegration/tests/unittests/SignatureHelpProviderTests.fs +++ b/vsintegration/tests/unittests/SignatureHelpProviderTests.fs @@ -22,6 +22,7 @@ module Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn.SignatureHelpProvider open System +open System.IO open System.Threading open System.Text @@ -46,11 +47,14 @@ open Microsoft.FSharp.Compiler.SourceCodeServices open Microsoft.FSharp.Compiler.Range let filePath = "C:\\test.fs" + +let PathRelativeToTestAssembly p = Path.Combine(Path.GetDirectoryName(Uri( System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath), p) + let internal options = { ProjectFileName = "C:\\test.fsproj" ProjectFileNames = [| filePath |] ReferencedProjects = [| |] - OtherOptions = [| |] + OtherOptions = [| "-r:" + PathRelativeToTestAssembly(@"UnitTestsResources\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll") |] IsIncompleteTypeCheckEnvironment = true UseScriptResolutionRules = false LoadTime = DateTime.MaxValue @@ -74,16 +78,65 @@ System.Console.WriteLine(1,arg1=2) ("arg1", Some ("[7..40)", 1, 2, Some "arg1")); ("=", Some ("[7..40)", 1, 2, Some "arg1")); ("2", Some ("[7..40)", 0, 2, None)); - (")", None)]) + (")", None)]); ( """ //2 open System Console.WriteLine([(1,2)]) """, - [("WriteLine(", Some ("[20..45)", 0, 0, None)); + [ + ("WriteLine(", Some ("[20..45)", 0, 0, None)); (",", None); - ("[(", Some ("[20..45)", 0, 1, None))]) - ] + ("[(", Some ("[20..45)", 0, 1, None)) + ]); + ( """ +//3 +type foo = N1.T< +type foo2 = N1.T +type foo2 = N1.T +type foo3 = N1.T +type foo4 = N1.T +type foo5 = N1.T +""", + [("type foo = N1.T<", Some ("[18..24)", 0, 0, None)); + ("type foo2 = N1.T<", Some ("[40..53)", 0, 0, Some "Param1")); + ("type foo2 = N1.T