Allow to select single word on double click in one line doc comment (KT-14327)

(cherry picked from commit 184d39a)

 #KT-14327 Fixed
This commit is contained in:
Nikolay Krasko
2016-10-24 19:52:36 +03:00
committed by Nikolay Krasko
parent ba0e36cdb1
commit e41cddd870
16 changed files with 83 additions and 1 deletions
@@ -34,7 +34,6 @@ class KotlinWordSelectionFilter : Condition<PsiElement>{
if (elementType == KtTokens.REGULAR_STRING_PART || elementType == KtTokens.ESCAPE_SEQUENCE) return true
if (e is KtContainerNode) return false
if (e.parent.firstChild.nextSibling == null && e.parent !is KtContainerNode) return false // skip nodes with the same range as their parent
return when (e.node.elementType) {
BLOCK, KDocElementTypes.KDOC_SECTION -> false
+3
View File
@@ -0,0 +1,3 @@
/** Doc comment <caret>here */
fun foo() {
}
+3
View File
@@ -0,0 +1,3 @@
/** Doc comment <selection><caret>here</selection> */
fun foo() {
}
+3
View File
@@ -0,0 +1,3 @@
/**<selection> Doc comment <caret>here </selection>*/
fun foo() {
}
+6
View File
@@ -0,0 +1,6 @@
/**
* Doc comment
* @param <caret>a The description of a.
*/
fun foo(a: Int) {
}
+6
View File
@@ -0,0 +1,6 @@
/**
* Doc comment
* @param <selection><caret>a</selection> The description of a.
*/
fun foo(a: Int) {
}
+6
View File
@@ -0,0 +1,6 @@
/**
* Doc comment
* <selection>@param <caret>a The description of a.</selection>
*/
fun foo(a: Int) {
}
+6
View File
@@ -0,0 +1,6 @@
/**
* Doc comment
* @pa<caret>ram a The description of a.
*/
fun foo(a: Int) {
}
+6
View File
@@ -0,0 +1,6 @@
/**
* Doc comment
* @<selection>pa<caret>ram</selection> a The description of a.
*/
fun foo(a: Int) {
}
+6
View File
@@ -0,0 +1,6 @@
/**
* Doc comment
* <selection>@pa<caret>ram</selection> a The description of a.
*/
fun foo(a: Int) {
}
+6
View File
@@ -0,0 +1,6 @@
/**
* Doc comment
* <selection>@pa<caret>ram a The description of a.</selection>
*/
fun foo(a: Int) {
}
+6
View File
@@ -0,0 +1,6 @@
/**
* Doc comment
* @param a The descr<caret>iption of a.
*/
fun foo(a: Int) {
}
+6
View File
@@ -0,0 +1,6 @@
/**
* Doc comment
* @param a The <selection>descr<caret>iption</selection> of a.
*/
fun foo(a: Int) {
}
+6
View File
@@ -0,0 +1,6 @@
/**
* Doc comment
* @param a <selection>The descr<caret>iption of a.</selection>
*/
fun foo(a: Int) {
}
+6
View File
@@ -0,0 +1,6 @@
/**
* Doc comment
* <selection>@param a The descr<caret>iption of a.</selection>
*/
fun foo(a: Int) {
}
@@ -51,6 +51,14 @@ public class WordSelectionTest extends KotlinLightCodeInsightFixtureTestCase {
public void testDocComment() { doTest(); }
public void testDocCommentOneLine() { doTest(); }
public void testDocCommentTagName() { doTest(); }
public void testDocCommentTagText() { doTest(); }
public void testDocCommentTagLink() { doTest(); }
public void testFunctionWithLineCommentBefore() { doTest(); }
public void testFunctionWithLineCommentAfter() { doTest(); }