Skip to content

Commit 72403d6

Browse files
committed
Add test for type nested in another generic type
Issue: Incorrect type format: ``ImmutableArray`1.Builder<int>`` instead of ``ImmutableArray<int>.Builder`` //TODO: how to format correctly?
1 parent fc6ca7a commit 72403d6

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/FsAutoComplete.Tests.Lsp/InlayHintTests.fs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,37 @@ let private typeHintTests state =
709709
let f (beta: int) = beta + 1
710710
"""
711711
]
712+
testCaseAsync "can show type for generic actual type" <|
713+
checkAllInMarkedRange server
714+
"""
715+
open System.Collections.Generic
716+
$|let list$0 = List<int>()$|
717+
list.Add 2
718+
"""
719+
[
720+
typeHint "List<int>"
721+
"""
722+
open System.Collections.Generic
723+
let list: List<int> = List<int>()
724+
list.Add 2
725+
"""
726+
]
727+
ptestCaseAsync "can show type hint for nested inside generic actual type" <|
728+
checkAllInMarkedRange server
729+
"""
730+
open System.Collections.Immutable
731+
$|let arr$0 = ImmutableArray.CreateBuilder()$|
732+
arr.Add 2
733+
"""
734+
[
735+
//Currently: `ImmutableArray`1.Builder<int>`
736+
typeHint "ImmutableArray<int>.Builder"
737+
"""
738+
open System.Collections.Immutable
739+
let arr: ImmutableArray<int>.Builder = ImmutableArray.CreateBuilder()
740+
arr.Add 2
741+
"""
742+
]
712743
])
713744
let private mixedHintTests state =
714745
serverTestList "inlay hints" state defaultConfigDto None (fun server -> [

0 commit comments

Comments
 (0)