File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 11{
22 "git-dependencies" : {
33 "direct" : {
4- "https://github.com/unisonweb/ui-core" : " 73ffa9d42290ce3d5deeb80acc19f4606b2f7685 "
4+ "https://github.com/unisonweb/ui-core" : " 7d8d5f9ee2e6de17f385e1ce90e87cc5b60e9c6e "
55 },
66 "indirect" : {}
77 }
Original file line number Diff line number Diff line change @@ -81,14 +81,26 @@ codebaseApiEndpointToEndpoint cbEndpoint =
8181
8282 CodebaseApi . Definition { perspective, ref } ->
8383 let
84- re =
85- Maybe . withDefault Regex . never ( Regex . fromString " #[d|a|]( \\ d+) $" )
84+ constructorSuffixRegex =
85+ Maybe . withDefault Regex . never ( Regex . fromString " #[ad] \\ d$" )
8686
87- stripConstructorPositionFromHash =
88- Regex . replace re ( always " " )
87+ withoutConstructorSuffix h =
88+ h
89+ |> Hash . toString
90+ |> Regex . replace constructorSuffixRegex ( always " " )
91+
92+ refToString r =
93+ case Reference . hashQualified r of
94+ HQ . NameOnly fqn ->
95+ FQN . toApiUrlString fqn
96+
97+ HQ . HashOnly h ->
98+ withoutConstructorSuffix h
99+
100+ HQ . HashQualified _ h ->
101+ withoutConstructorSuffix h
89102 in
90- [ Reference . toApiUrlString ref ]
91- |> List . map stripConstructorPositionFromHash
103+ [ refToString ref ]
92104 |> List . map ( string " names" )
93105 |> ( \ names -> GET { path = [ " getDefinition" ], queryParams = names ++ perspectiveToQueryParams perspective } )
94106
You can’t perform that action at this time.
0 commit comments