KT-6582 "Expand selection" in string literal should select word in string
#KT-6582 fixed
This commit is contained in:
+1
-1
@@ -32,7 +32,7 @@ public class KotlinWordSelectionFilter : Condition<PsiElement>{
|
||||
if (e.getParent().getFirstChild().getNextSibling() == null && e.getParent() !is JetContainerNode) return false // skip nodes with the same range as their parent
|
||||
|
||||
return when (e.getNode().getElementType()) {
|
||||
BLOCK, LITERAL_STRING_TEMPLATE_ENTRY, KDocElementTypes.KDOC_SECTION -> false
|
||||
BLOCK, KDocElementTypes.KDOC_SECTION -> false
|
||||
else -> true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fun main(args: Array<String>) {
|
||||
println("<caret>foo bar")
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun main(args: Array<String>) {
|
||||
println("<selection><caret>foo</selection> bar")
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun main(args: Array<String>) {
|
||||
println("<selection><caret>foo bar</selection>")
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun main(args: Array<String>) {
|
||||
println(<selection>"<caret>foo bar"</selection>)
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
val v = "<selection>aaa $x <caret>bbb</selection>"
|
||||
val v = "aaa $x<selection> <caret>bbb</selection>"
|
||||
@@ -1 +1 @@
|
||||
val v = <selection>"aaa $x <caret>bbb"</selection>
|
||||
val v = "<selection>aaa $x <caret>bbb</selection>"
|
||||
@@ -0,0 +1 @@
|
||||
val v = <selection>"aaa $x <caret>bbb"</selection>
|
||||
@@ -50,6 +50,7 @@ public class WordSelectionTest extends JetLightCodeInsightFixtureTestCase {
|
||||
public void testCommentForStatements() { doTest(); }
|
||||
|
||||
public void testSimpleStringLiteral() { doTest(); }
|
||||
public void testSimpleStringLiteral2() { doTest(); }
|
||||
|
||||
public void testTemplateStringLiteral1() { doTest(); }
|
||||
public void testTemplateStringLiteral2() { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user