Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
8ba6c45
Align QuickInfo colors with classification colors
cartermp Jun 25, 2020
01a74f0
Color methods in tooltips properly
cartermp Jun 26, 2020
01d0e39
Tag locals and see if we can tag functions better
cartermp Jun 27, 2020
92e4d1a
Tag interface when value or return value properly
cartermp Jun 27, 2020
a5c7583
tag intrinsics better and refactor
cartermp Jun 27, 2020
f050fc4
Color functions in tooltips + consistent operator treatment
cartermp Jun 28, 2020
fa325fc
tag abbreviations for value types as value types
cartermp Jun 28, 2020
65b618e
Move isFunction and use it in pretty-printing
cartermp Jun 28, 2020
daa0be7
Be a little smarter about laying out IL reference and value types
cartermp Jun 29, 2020
a936718
Use entirely different routine for laying out object data
cartermp Jun 30, 2020
fc7ca1b
Don't show 'inherit ValueType'
cartermp Jun 30, 2020
5e0a8e1
filter out ctors when looking at methods
cartermp Jun 30, 2020
aa65819
Lay out everything else for types
cartermp Jun 30, 2020
a9ca0c9
final formatting changes for props probably
cartermp Jun 30, 2020
4380cde
Simplify
cartermp Jun 30, 2020
b418fc9
remove as much ILTyeRef printing as possible (so far)
cartermp Jun 30, 2020
ee15fb4
updates
cartermp Jul 1, 2020
ac0a377
remove nonsense + commented out stuff
cartermp Jul 1, 2020
d011ecf
Don't show compiler-generated interfaces for record/union/struct
cartermp Jul 1, 2020
8fda6b0
testing updates and some tweaks
cartermp Jul 1, 2020
040d00f
Updates
cartermp Jul 1, 2020
d2659a9
Updates
cartermp Jul 2, 2020
47d0255
updates
cartermp Jul 2, 2020
66d8ec1
updates
cartermp Jul 2, 2020
1a4ebf8
Update more tests
cartermp Jul 2, 2020
aedc087
updates
cartermp Jul 2, 2020
97518d8
updates + small refactor
cartermp Jul 2, 2020
92ab13f
test updates
cartermp Jul 2, 2020
30e0929
Test updates
cartermp Jul 3, 2020
b0e44e7
Don't shrink overloads when printing signatures
cartermp Jul 3, 2020
25f25dc
print members consistently
cartermp Jul 6, 2020
c901275
Update tests
cartermp Jul 6, 2020
6eaf3e1
test updates
cartermp Jul 7, 2020
8f33f3f
Update fsharpqa tests
cartermp Jul 7, 2020
624e48b
Handle delegates
cartermp Jul 7, 2020
2db31cb
Enums
cartermp Jul 7, 2020
2ecb32d
Show struct attribute for all structs
cartermp Jul 7, 2020
e2d8d00
Filter class constructors
cartermp Jul 8, 2020
b53677e
cleanup and test update
cartermp Jul 8, 2020
e0bf942
more filter
cartermp Jul 9, 2020
48a6b34
additional option for sigs
cartermp Jul 10, 2020
9a9f326
Updates
cartermp Jul 11, 2020
4ea1dae
cleanup
cartermp Jul 11, 2020
02ad676
more cleanup
cartermp Jul 11, 2020
b8fa5c9
Update printing baselines
cartermp Jul 11, 2020
55b4bbd
Don't omit attribute + clean up discard intrinsics (found almost excl…
cartermp Jul 11, 2020
0ef41a8
Test updates
cartermp Jul 12, 2020
a655036
Test updates
cartermp Jul 12, 2020
6a90d81
Test updates
cartermp Jul 13, 2020
6fcc552
Test updates
cartermp Jul 13, 2020
c88bc49
Fix 6160
cartermp Jul 13, 2020
fac0338
Fix classification for unresolved/impossible-to-construct constructors
cartermp Jul 13, 2020
f6dbaab
update test again lol
cartermp Jul 13, 2020
4027233
Updates
cartermp Aug 26, 2020
983c44b
Update
cartermp Aug 26, 2020
76beeda
Update netstandard surface
cartermp Aug 26, 2020
4ad02be
Try updating this baseline I guess
cartermp Sep 6, 2020
7f28a88
merge
cartermp Nov 12, 2020
4f9e718
yoop
cartermp Nov 12, 2020
b5a8f40
Update baselines
cartermp Nov 13, 2020
65506bd
Feedback
cartermp Nov 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
testing updates and some tweaks
  • Loading branch information
cartermp committed Nov 12, 2020
commit 8fda6b09a25c8006546a79c787bc04f2a3aba7b0
7 changes: 5 additions & 2 deletions src/fsharp/NicePrint.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1837,24 +1837,27 @@ module private TastDefinitionPrinting =
|> List.groupBy (fun md -> md.DisplayName)
|> List.collect (fun (_, group) -> shrinkOverloads (InfoMemberPrinting.layoutMethInfoFSharpStyle amap m denv) (fun x xL -> (sortKey x, xL)) group)

let inline isDiscard (name: string) = name.StartsWith("_")

let fieldLs =
infoReader.GetILFieldInfosOfType (None, ad, m, ty)
|> List.filter (fun fld -> not (isDiscard fld.FieldName))
|> List.map (fun x -> (true, x.IsStatic, x.FieldName, 0, 0), layoutILFieldInfo denv amap m x)

let staticValsLs =
if isRecdTy g ty then
[]
else
tycon.TrueFieldsAsList
|> List.filter (fun f -> f.IsStatic)
|> List.filter (fun f -> f.IsStatic && not (isDiscard f.Name))
|> List.map (fun f -> WordL.keywordStatic ^^ WordL.keywordVal ^^ layoutRecdField true denv f)

let instanceValsLs =
if isRecdTy g ty then
[]
else
tycon.TrueFieldsAsList
|> List.filter (fun f -> not f.IsStatic)
|> List.filter (fun f -> not f.IsStatic && not (isDiscard f.Name))
|> List.map (fun f -> WordL.keywordVal ^^ layoutRecdField true denv f)

let propLs =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@ type UsingMSBuild() =
MoveCursorToStartOfMarker(file, "(*M*)")
let tooltip = time1 GetQuickInfoAtCursor file "Time of first tooltip"
AssertContainsInOrder(tooltip, expectedExactOrder)


[<Test>]
member public this.``EmptyTypeTooltipBody``() =
let content = """
type X(*M*) = class end"""
this.VerifyQuickInfoDoesNotContainAnyAtStartOfMarker content "(*M*)" "="

[<Test>]
member public this.``NestedTypesOrder``() =
Expand Down Expand Up @@ -274,16 +267,16 @@ type UsingMSBuild() =
"""
let expectedTooltip = """
type Async =
static member AsBeginEnd : computation:('Arg -> Async<'T>) -> ('Arg * AsyncCallback * obj -> IAsyncResult) * (IAsyncResult -> 'T) * (IAsyncResult -> unit)
static member AwaitEvent : event:IEvent<'Del,'T> * ?cancelAction:(unit -> unit) -> Async<'T> (requires delegate and 'Del :> Delegate)
static member AwaitIAsyncResult : iar:IAsyncResult * ?millisecondsTimeout:int -> Async<bool>
static member AwaitTask : task:Task -> Async<unit>
static member AwaitTask : task:Task<'T> -> Async<'T>
static member AwaitWaitHandle : waitHandle:WaitHandle * ?millisecondsTimeout:int -> Async<bool>
static member AsBeginEnd<'Arg,'T> : computation: 'Arg -> Async<'T> -> ('Arg * AsyncCallback * obj -> IAsyncResult) * (IAsyncResult -> 'T) * (IAsyncResult -> unit)
static member AwaitEvent<'Del,'T (requires delegate and 'Del :> Delegate)> : event: IEvent<'Del,'T> *?cancelAction: unit -> unit -> Async<'T>
static member AwaitIAsyncResult : iar: IAsyncResult *?millisecondsTimeout: int -> Async<bool>
static member AwaitTask<'T> : task: Task<'T> -> Async<'T> + 1 overload
static member AwaitWaitHandle : waitHandle: WaitHandle *?millisecondsTimeout: int -> Async<bool>
static member CancelDefaultToken : unit -> unit
static member Catch : computation:Async<'T> -> Async<Choice<'T,exn>>
static member Choice : computations:seq<Async<'T option>> -> Async<'T option>
static member FromBeginEnd : beginAction:(AsyncCallback * obj -> IAsyncResult) * endAction:(IAsyncResult -> 'T) * ?cancelAction:(unit -> unit) -> Async<'T>
static member CancellationToken : Async<CancellationToken> with get
static member Catch<'T> : computation: Async<'T> -> Async<Choice<'T,exn>>
static member Choice<'T> : computations: seq<Async<'T option>> -> Async<'T option>
static member DefaultCancellationToken : CancellationToken with get
...
Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n")

Expand Down Expand Up @@ -385,7 +378,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n")
let a = typeof<N.T(*Marker*)> """

this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "T(*Marker*)",
"type T =\n new : unit -> T\n event Event1 : EventHandler\n static member M : unit -> int []\n static member StaticProp : decimal\nFull name: N.T",
"type T =\n new : unit -> T\n event Event1 : EventHandler\n static member M : unit -> int []\n static member StaticProp : decimal with get\nFull name: N.T",
addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithEmptyComment.dll")])


Expand Down Expand Up @@ -1029,7 +1022,7 @@ let f (tp:ITypeProvider(*$$$*)) = tp.Invalidate
this.AssertQuickInfoContainsAtEndOfMarker
("""let f x = x + 1 ""","let f","int")

[<Test>]
[<Test; Ignore(".NET classes are treated differently now. Should this be revisited? Probably not.")>]
member public this.``FrameworkClass``() =
let fileContent = """let l = new System.Collections.Generic.List<int>()"""
let marker = "Generic.List"
Expand Down Expand Up @@ -1941,34 +1934,6 @@ let f (tp:ITypeProvider(*$$$*)) = tp.Invalidate
"[Signature:M:System.String.Format(System.String,System.Object[])]";
]
)

[<Test>]
member public this.``Regression.MemberDefinition.DocComments.Bug5856_12``() =
this.AssertMemberDataTipContainsInOrder
((*code *)
[
"System."
] ,
(* marker *)
"System.",
(* completed item *)
"Action",
(* expect to see in order... *)
[
"type Action";
" delegate of"
"[Filename:"; "mscorlib.dll]";
"[Signature:T:System.Action]"
"type Action<";
" delegate of"
"[Filename:"; "mscorlib.dll]";
"[Signature:T:System.Action`1]"
"type Action<";
" delegate of"
"[Filename:"; "mscorlib.dll]";
"[Signature:T:System.Action`2]"
]
)

[<Test>]
member public this.``Regression.MemberDefinition.DocComments.Bug5856_13``() =
Expand Down Expand Up @@ -2096,7 +2061,7 @@ query."

/// Bug 4592: Check that ctors are displayed from C# classes, i.e. the "new" lines below.
[<Test>]
member public this.``Regression.Class.Printing.CSharp.Classes.Only..Bug4592``() =
member public this.``Regression.Class.Printing.CSharp.Classes.Only.Bug4592``() =
this.AssertMemberDataTipContainsInOrder
((*code *)
["#light";
Expand All @@ -2107,10 +2072,11 @@ query."
"Random",
(* expect to see in order... *)
["type Random =";
" new : unit -> Random + 1 overload";
" new: unit -> unit +1 overload"
" member Next : unit -> int + 2 overloads";
" member NextBytes : buffer:byte[] -> unit"; (* methods sorted alpha *)
" member NextDouble : unit -> float";]
" member NextBytes : buffer:byte[] -> unit";
" member NextDouble : unit -> float";
" member Sample : unit -> float";]
)

[<Test>]
Expand Down Expand Up @@ -2145,14 +2111,14 @@ query."
[ "type CodeConnectAccess =";
" new : allowScheme:string * allowPort:int -> CodeConnectAccess";
" member Equals : o:obj -> bool";
" member GetHashCode : unit -> int"; (* method *)
" member Port : int";
" member Scheme : string";
" static val DefaultPort : int"; (* static val after instance, but before static method *)
" static val OriginPort : int";
" static val OriginScheme : string";
" static val AnyScheme : string";
" static member CreateAnySchemeAccess : allowPort:int -> CodeConnectAccess";
" member GetHashCode : unit -> int";
" member IsAnyScheme : bool with get";
" member IsDefaultPort : bool with get";
" member IsOriginPort : bool with get";
" member IsOriginPortScheme : bool with get";
" member Port : int with get";
" member Scheme : string with get";
" member StrPort : string with get";
" ...";
])

Expand Down Expand Up @@ -2194,19 +2160,14 @@ query."
" inherit Form";
" interface IDisposable";
" new : unit -> F1";
" static val x: F1";
" val x: F1";
" abstract member AAA : int";
" abstract member ZZZ : int";
" abstract member AAA : bool with set";
" member B : unit -> int";
" member D : unit -> int";
" member D : x:int -> int";
" abstract member AAA : int with get, set";
" abstract member B : unit -> int";
" abstract member D: int";
" abstract member ToString : unit -> string";
" abstract member ZZZ : int with get";
" ...";
//" member D : int";
//" member D : int with set";
//" static val x: F1";
//" static member A : unit -> int";
//" static member C : unit -> int";
])

(*------------------------------------------IDE automation starts here -------------------------------------------------*)
Expand All @@ -2221,12 +2182,6 @@ query."
internal new(x:int,y:int) = new Foo2()
private new(x:int,y:int,z:int) = new Foo2()"""
this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker*)", "type internal Foo2")
this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker*)", "private new : x:int * y:int * z:int -> Foo2")
this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker*)", "new : x:int * y:int -> Foo2")
this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker*)", "private new")
this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker*)", "member Prop1")
this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker*)", "member Prop2")
this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker*)", "member private Prop3")

[<Test>]
member public this.``Automation.Regression.AccessorsAndMutators.Bug4276``() =
Expand Down Expand Up @@ -2737,7 +2692,6 @@ query."
this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker3_1*)", "type IA =")
this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker3_2*)", "type ClassIA =")
this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker4_1*)", "type GenericClass<'a (requires 'a :> IA)> =")
this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker4_1*)", "static member StaticMember : x:'a -> int")
this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker4_2*)", "val genericClass : GenericClass<ClassIA>")
this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker5_1*)", "type AbAttrName = AbstractClassAttribute")
this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker5_2*)", "type AbAttrName = AbstractClassAttribute")
Expand Down