Code folding: syntax highlight inside placeholder

Hello, I want to show function body implementation inside the placeholder, I did implementation for this: https://gist.github.com/sysint64/43f8b51708e058fc2d626a498518c30b

I would like highlight the code inside the placeholder:

In my implementation it looks like this:

how can I implement such a thing?

0

finally I found solution:

val range1 = TextRange(rightBrace.textOffset, body.textOffset)
val range2 = TextRange(body.textRange.endOffset, rightBrace.textRange.endOffset)

val group = FoldingGroup.newGroup("one-liner")
descriptors += FoldingDescriptor(leftBrace.node, range1, group)
descriptors += FoldingDescriptor(rightBrace.node, range2, group)

 

0

请先登录再写评论。