Youssef Shoaib [MOD]
11/22/2023, 11:40 PM`hello`
and makes them appear without the backticks? I saw some plugins that do that to prettify certain parts of languages (e.g. python's lambda being replaced by the greek letter lambda)elect
11/23/2023, 1:20 PMYoussef Shoaib [MOD]
11/23/2023, 9:28 PMYoussef Shoaib [MOD]
11/23/2023, 10:19 PMYoussef Shoaib [MOD]
11/23/2023, 11:55 PM!
)
• Add the option to provide a custom format string for the function's arguments (medium. Varargs are difficult. Need to decide whether to exclude lambdas or not and when?)
• Implement custom infix left/right operators with custom precedence (very hard. Note that this, like the rest, are in folding only, so it might be strange to type out).
• Add option to fold single expression if-else to ternary operatorAdam S
11/24/2023, 12:20 AMelect
11/24/2023, 12:23 AMYoussef Shoaib [MOD]
11/24/2023, 12:51 AMinfix fun Boolean.`?`(value: Any): Any = TODO()
infix fun Boolean.`&`(other: Boolean): Boolean = TODO()
@Pretty(":")
infix fun Any.orElse(other: Any): Any = TODO()
@Pretty("<<")
infix fun Any.shiftLeft(other: Any): Any = TODO()
@Pretty(">>")
infix fun Any.shiftRight(other: Any): Any = TODO()
@Pretty("if")
fun magicIf(condition: Any, block: () -> Unit): Any = TODO()
Now when I write:
true `?` 1 orElse 2
true `&` false
1 shiftLeft 2 shiftRight 3
magicIf(true) {
println("Hello")
}
It displays as the attached image (as long as you turn off the color for folded text in settings)Youssef Shoaib [MOD]
11/24/2023, 1:05 AMelect
11/24/2023, 10:35 AMYoussef Shoaib [MOD]
11/24/2023, 12:35 PM@Pretty
to change how a function is displayed might be a lot nicer than changing its name to a backticked one.