@@ -25,17 +25,22 @@ module internal rec AST =
25
25
let (| CallTag | _ |) condition =
26
26
function
27
27
| Call( Import( importInfo, LambdaType(_, DeclaredType( typ, _)), _), callInfo, _, range) when condition importInfo ->
28
- let tagName = typ.FullName.Split( '.' ) |> Seq.last
29
- let finalTagName =
30
- if tagName = " Fragment" then
31
- " "
32
- elif tagName.EndsWith( " '" ) then
33
- tagName.Substring( 0 , tagName.Length - 1 )
34
- elif tagName.EndsWith( " `1" ) then
35
- tagName.Substring( 0 , tagName.Length - 2 )
36
- else
37
- tagName
38
- Some( AutoImport finalTagName, callInfo, range)
28
+ let tagImport =
29
+ match callInfo.Args with
30
+ | Let(_, LibraryTagImport( imp, _), _) :: _ -> LibraryImport imp
31
+ | _ ->
32
+ let tagName = typ.FullName.Split( '.' ) |> Seq.last
33
+ let finalTagName =
34
+ if tagName = " Fragment" then
35
+ " "
36
+ elif tagName.EndsWith( " '" ) then
37
+ tagName.Substring( 0 , tagName.Length - 1 )
38
+ elif tagName.EndsWith( " `1" ) then
39
+ tagName.Substring( 0 , tagName.Length - 2 )
40
+ else
41
+ tagName
42
+ AutoImport finalTagName
43
+ Some( tagImport, callInfo, range)
39
44
| _ -> None
40
45
41
46
let (| TagNoChildren | _ |) ( expr : Expr ) =
0 commit comments