Is it possible to set the language (eg Kotlin) for...
# meta
n
Is it possible to set the language (eg Kotlin) for a code snippet ( https://kotlinlang.slack.com/archives/C3SGXARS6/p1741471858894129?thread_ts=1741471578.895299&cid=C3SGXARS6 ), and if so how?
s
I doubt it. But for multi-line code snippets, you should definitely use triple back quotes
Copy code
instead to get one big block of code instead of this.

So you'd see this result instead:
```private fun toggleGpioPin(chip: CPointer<*>, line: CPointer<*>) {
    var value = 0
    while (true) {
        sleep(1u)
        value = if (value == 0) 1 else 0
        if (gpiod_line_set_value(line.reinterpret(), value) == -1) {
            gpiod_chip_close(chip.reinterpret())
            throw IllegalStateException("Cannot set value for GPIO pin")
        }
    }
}
1
🆗 1
e
that's a code block
slack has a different feature, text snippets in the (+) menu, which support syntax highlighting
👆 2