Pair parenthesis before end of string template

#KT-6403 Fixed
This commit is contained in:
Nikolay Krasko
2014-12-05 20:53:37 +03:00
parent 3d7bbc0bde
commit 7d32358bf8
2 changed files with 14 additions and 1 deletions
@@ -54,7 +54,8 @@ public class JetPairMatcher implements PairedBraceMatcher {
|| contextType == JetTokens.RPAR
|| contextType == JetTokens.RBRACKET
|| contextType == JetTokens.RBRACE
|| contextType == JetTokens.LBRACE;
|| contextType == JetTokens.LBRACE
|| contextType == JetTokens.LONG_TEMPLATE_ENTRY_END;
}
@Override
@@ -222,6 +222,18 @@ public class TypedHandlerTest : LightCodeInsightTestCase() {
"}"
)
public fun testAutoInsertParenInStringLiteral(): Unit = doCharTypeTest(
'(',
"""fun f() { println("$amp{f<caret>}") }""",
"""fun f() { println("$amp{f(<caret>)}") }"""
)
public fun testAutoInsertParenInCode(): Unit = doCharTypeTest(
'(',
"""fun f() { val a = f<caret> }""",
"""fun f() { val a = f(<caret>) }"""
)
public fun testTypeLtInFunDeclaration() {
doLtGtTest("fun <caret>")
}