add word selection step for selecting a type parameter or type argument list with enclosing brackets
#KT-6697 Fixed
This commit is contained in:
@@ -39,6 +39,11 @@ public class KotlinListSelectioner : ExtendWordSelectionHandlerBase() {
|
||||
val node = e.getNode()!!
|
||||
val startNode = node.findChildByType(TokenSet.create(JetTokens.LPAR, JetTokens.LT)) ?: return null
|
||||
val endNode = node.findChildByType(TokenSet.create(JetTokens.RPAR, JetTokens.GT)) ?: return null
|
||||
return listOf(TextRange(startNode.getStartOffset() + 1, endNode.getStartOffset()))
|
||||
val innerRange = TextRange(startNode.getStartOffset() + 1, endNode.getStartOffset())
|
||||
if (e is JetTypeArgumentList || e is JetTypeParameterList) {
|
||||
return listOf(innerRange,
|
||||
TextRange(startNode.getStartOffset(), endNode.getStartOffset() + endNode.getTextLength()))
|
||||
}
|
||||
return listOf(innerRange)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
fun <A, B> foo() {
|
||||
<selection>foo<I<caret>nt, B>()</selection>
|
||||
foo<selection><I<caret>nt, B></selection>()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fun <A, B> foo() {
|
||||
<selection>foo<I<caret>nt, B>()</selection>
|
||||
}
|
||||
+1
-2
@@ -1,3 +1,2 @@
|
||||
<selection>fun <A, <caret>B> foo() {
|
||||
fun <selection><A, <caret>B></selection> foo() {
|
||||
}
|
||||
</selection>
|
||||
@@ -0,0 +1,3 @@
|
||||
<selection>fun <A, <caret>B> foo() {
|
||||
}
|
||||
</selection>
|
||||
Reference in New Issue
Block a user