How to create PsiElement of String Template with triple quoted String with new line character[Kotlin]

Answered
val multiLine = """hello ${"\n"}world"""
val e1 = KtPsiFactory(psiElement.project).createStringTemplate(multiLine)

This is giving assertionError

0
1 comment

You should pass a line break just as \n:

val multiLine = """hello \nworld"""

With your example syntax of the resulting expression will be invalid:

val x =
"hello
world"

 

 

0

Please sign in to leave a comment.