Problem:
Example:
Error: no overload matches 'Sodium::Cipher::Aead::Xchacha20Poly1305Ietf#decrypt_detached'
with types Slice(UInt8), nonce: Sodium::Nonce, mac: Slice(UInt8), additional: String
Overloads are:
- Sodium::Cipher::Aead::Xchacha20Poly1305Ietf#decrypt_detached(src : Bytes,
- - dst : Bytes | ::Nil = nil, *, nonce : Nonce,
- - mac : Bytes, additional : Bytes | ::Nil = nil)
- Sodium::Cipher::Aead::Chalsa#decrypt_detached(data,
- - dst : Bytes | ::Nil = nil, *,
- - mac : Bytes | ::Nil = nil, additional = nil)
Feature request:
Colorize could help, but only when color is supported (for example on a TTY).
A good improvement would probably already be when we get the types at call site and the overloads formatted in the same way, using a proper crystal format style. This would make it easier to read the signatures and help compare them.
Additionally, it would be super great if matching arguments could be lined up similarly. This should work great for short signatures. But as soon as there are many arguments which span multiple lines and optional arguments not present everywhere, this becomes super complicated.
Example for a relatively simple set of overloads:
Call:
- foo(String, c: Nil)
Overloads are:
- foo(a : String, b : Int32 = 0, c : Bool = true)
- foo(a : String, b : Float64, c : Bool = false)
- foo(a : String, b : Int64, c : Bool)
- foo(a : Time::Location, b, c : Nil)
The class and method name take a lot of horizontal space. Show it once?
Sodium::Cipher::Aead::Xchacha20Poly1305Ietf#decrypt_detached
Most helpful comment
Colorize could help, but only when color is supported (for example on a TTY).
A good improvement would probably already be when we get the types at call site and the overloads formatted in the same way, using a proper
crystal formatstyle. This would make it easier to read the signatures and help compare them.Additionally, it would be super great if matching arguments could be lined up similarly. This should work great for short signatures. But as soon as there are many arguments which span multiple lines and optional arguments not present everywhere, this becomes super complicated.
Example for a relatively simple set of overloads: