Skip to content

Commit

Permalink
refactor: keep fully qualified names
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Hivert <[email protected]>
  • Loading branch information
ghivert committed May 14, 2024
1 parent 0324ede commit 1d18aa0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/backend/src/backend/gleam/generate/sources.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,20 @@ fn type_to_string(type_: Type) {
|> result.map(string.from_utf_codepoints)
|> result.unwrap("a")
}
package_interface.Named(name, _package, _module, parameters) -> {
package_interface.Named(name, package, module, parameters) -> {
parameters
|> list.map(type_to_string)
|> string.join(", ")
|> fn(s) {
use <- bool.guard(when: string.is_empty(s), return: s)
"(" <> s <> ")"
}
|> string.append(name, _)
|> fn(params) {
case package {
"" -> name <> params
_ -> module <> "." <> name <> params
}
}
}
}
}
Expand Down

0 comments on commit 1d18aa0

Please sign in to comment.