Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit93bd099

Browse files
committed
Fix language service unit tests
1 parentadb4fa2 commit93bd099

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

‎src/fsharp/NicePrint.fs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ open Microsoft.FSharp.Compiler.Layout
3636
openMicrosoft.FSharp.Compiler.PrettyNaming
3737

3838
[<AutoOpen>]
39-
moduleprivatePrintUtilities=
39+
moduleinternalPrintUtilities=
4040
letbracketIfL x lyt=if xthen bracketL lytelse lyt
4141
letsquareAngleL x= leftL"[<"^^ x^^ rightL">]"
4242
letangleL x= sepL"<"^^ x^^ rightL">"
@@ -70,7 +70,6 @@ module private PrintUtilities =
7070
|[x]->[resultFunction x(layoutFunction x)]
7171
|(x:: rest)->[ resultFunction x(layoutFunction x-- leftL(match rest.Lengthwith1-> FSComp.SR.nicePrintOtherOverloads1()| n-> FSComp.SR.nicePrintOtherOverloadsN(n)))]
7272
|_->[]
73-
7473

7574
letlayoutTyconRefImpl isAttribute(denv:DisplayEnv)(tcref:TyconRef)=
7675
letdemangled=

‎src/fsharp/vs/service.fs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ module internal Params =
110110
"","", pty
111111
// Layout a named argument
112112
| Some nm,_,_->
113-
letprefix=if isParamArrayArgthen sprintf"params%s:" nmelse sprintf"%s:" nm
113+
letprefix=
114+
if isParamArrayArgthen
115+
sprintf"%s%s:"(NicePrint.PrintUtilities.layoutBuiltinAttribute denv denv.g.attrib_ParamArrayAttribute|> showL) nm
116+
else
117+
sprintf"%s:" nm
114118
nm, prefix,pty)
115119
|> List.unzip3
116120
letparamTypeAndRetLs,_= NicePrint.layoutPrettifiedTypes denv(paramTypes@[rty])

‎vsintegration/src/unittests/Tests.LanguageService.ErrorList.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ let x =
273273
CheckErrorList content<|
274274
fun errors->
275275
Assert.AreEqual(1, List.length errors)
276-
assertContains errors"A unique overload for method 'WriteLine' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: System.Console.WriteLine(buffer: char []) : unit, System.Console.WriteLine(format: string,params arg: obj []) : unit, System.Console.WriteLine(value: obj) : unit, System.Console.WriteLine(value: string) : unit"
276+
assertContains errors"A unique overload for method 'WriteLine' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: System.Console.WriteLine(buffer: char []) : unit, System.Console.WriteLine(format: string,[<System.ParamArray>] arg: obj []) : unit, System.Console.WriteLine(value: obj) : unit, System.Console.WriteLine(value: string) : unit"
277277

278278
[<Test>]
279279
memberpublicthis.``InvalidMethodOverload2``()=

‎vsintegration/src/unittests/Tests.LanguageService.ParameterInfo.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1745,7 +1745,7 @@ We really need to rewrite some code paths here to use the real parse tree rather
17451745
)
17461746
|> Seq.tryFind(fun(i,_)-> i=2)
17471747
match overloadWithTwoParamsOptwith
1748-
| Some(_,[_;(_name, display,_description)])-> Assert.IsTrue(display.Contains("params args"))
1748+
| Some(_,[_;(_name, display,_description)])-> Assert.IsTrue(display.Contains("[<System.ParamArray>] args"))
17491749
| x-> Assert.Fail(sprintf"Expected overload not found, current result%A" x)
17501750

17511751
(* DotNet functions for multi-parameterinfo tests --------------------------------------------------*)

‎vsintegration/src/unittests/Tests.LanguageService.QuickInfo.fs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ type QuickInfoTests() =
466466
letfileContents="""
467467
let t = "a".Split('c')"""
468468

469-
this.AssertQuickInfoContainsAtEndOfMarker(fileContents,"Spl","params separator")
469+
this.AssertQuickInfoContainsAtEndOfMarker(fileContents,"Spl","[<System.ParamArray>] separator")
470470

471471
[<Test>]
472472
[<Category("TypeProvider")>]
@@ -919,7 +919,7 @@ type QuickInfoTests() =
919919
type A() =
920920
static member Foo([<System.ParamArrayAttribute>] a : int[]) = ()
921921
let r = A.Foo(42)""",
922-
"type A","params a:")
922+
"type A","[<ParamArray>] a:")
923923

924924
[<Test>]
925925
memberpublicthis.``ParamsArrayArgument.OnMethod``()=
@@ -928,7 +928,7 @@ type QuickInfoTests() =
928928
type A() =
929929
static member Foo([<System.ParamArrayAttribute>] a : int[]) = ()
930930
let r = A.Foo(42)""",
931-
"A.Foo","params a:")
931+
"A.Foo","[<System.ParamArray>] a:")
932932

933933
[<Test>]
934934
memberpublicthis.``Regression.AccessorMutator.Bug4903e``()=

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp