diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml
index c264fcd947c..46e8fa1bf41 100644
--- a/idea/src/META-INF/plugin.xml
+++ b/idea/src/META-INF/plugin.xml
@@ -635,6 +635,7 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
+
diff --git a/idea/src/META-INF/plugin.xml.173 b/idea/src/META-INF/plugin.xml.173
index 0ff13128267..3a3788a0e4c 100644
--- a/idea/src/META-INF/plugin.xml.173
+++ b/idea/src/META-INF/plugin.xml.173
@@ -633,6 +633,7 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
+
diff --git a/idea/src/META-INF/plugin.xml.181 b/idea/src/META-INF/plugin.xml.181
index 33ea02437ed..1dd761ffa82 100644
--- a/idea/src/META-INF/plugin.xml.181
+++ b/idea/src/META-INF/plugin.xml.181
@@ -634,6 +634,7 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
+
diff --git a/idea/src/META-INF/plugin.xml.183 b/idea/src/META-INF/plugin.xml.183
index 4adb6e3fad2..507496a57ba 100644
--- a/idea/src/META-INF/plugin.xml.183
+++ b/idea/src/META-INF/plugin.xml.183
@@ -635,6 +635,7 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
+
diff --git a/idea/src/META-INF/plugin.xml.as31 b/idea/src/META-INF/plugin.xml.as31
index 5e756a1612d..80ded5b1f7a 100644
--- a/idea/src/META-INF/plugin.xml.as31
+++ b/idea/src/META-INF/plugin.xml.as31
@@ -633,6 +633,7 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
+
diff --git a/idea/src/META-INF/plugin.xml.as32 b/idea/src/META-INF/plugin.xml.as32
index d6a737ba889..f2045eb3915 100644
--- a/idea/src/META-INF/plugin.xml.as32
+++ b/idea/src/META-INF/plugin.xml.as32
@@ -633,6 +633,7 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
+
diff --git a/idea/src/META-INF/plugin.xml.as33 b/idea/src/META-INF/plugin.xml.as33
index 9b519c58a72..be076f69827 100644
--- a/idea/src/META-INF/plugin.xml.as33
+++ b/idea/src/META-INF/plugin.xml.as33
@@ -634,6 +634,7 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
+
diff --git a/idea/src/org/jetbrains/kotlin/idea/editor/wordSelection/KotlinLabeledReturnSelectioner.kt b/idea/src/org/jetbrains/kotlin/idea/editor/wordSelection/KotlinLabeledReturnSelectioner.kt
new file mode 100644
index 00000000000..f982172f9a6
--- /dev/null
+++ b/idea/src/org/jetbrains/kotlin/idea/editor/wordSelection/KotlinLabeledReturnSelectioner.kt
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
+ * that can be found in the license/LICENSE.txt file.
+ */
+
+package org.jetbrains.kotlin.idea.editor.wordSelection
+
+import com.intellij.codeInsight.editorActions.ExtendWordSelectionHandlerBase
+import com.intellij.openapi.editor.Editor
+import com.intellij.openapi.util.TextRange
+import com.intellij.psi.PsiElement
+import org.jetbrains.kotlin.psi.KtReturnExpression
+import org.jetbrains.kotlin.psi.psiUtil.endOffset
+import org.jetbrains.kotlin.psi.psiUtil.startOffset
+
+class KotlinLabeledReturnSelectioner : ExtendWordSelectionHandlerBase() {
+ override fun canSelect(e: PsiElement) = e is KtReturnExpression
+
+ override fun select(e: PsiElement, editorText: CharSequence, cursorOffset: Int, editor: Editor): List? {
+ if (e !is KtReturnExpression) return null
+ val labelQualifier = e.labelQualifier ?: return null
+ return listOf(TextRange(e.startOffset, labelQualifier.endOffset))
+ }
+}
\ No newline at end of file
diff --git a/idea/testData/wordSelection/LabeledReturn/0.kt b/idea/testData/wordSelection/LabeledReturn/0.kt
new file mode 100644
index 00000000000..892797b7d75
--- /dev/null
+++ b/idea/testData/wordSelection/LabeledReturn/0.kt
@@ -0,0 +1,8 @@
+fun test(list: List) {
+ list.mapNotNull {
+ if (it == 0) {
+ return@mapNotNull null
+ }
+ it
+ }
+}
\ No newline at end of file
diff --git a/idea/testData/wordSelection/LabeledReturn/1.kt b/idea/testData/wordSelection/LabeledReturn/1.kt
new file mode 100644
index 00000000000..41bae16e661
--- /dev/null
+++ b/idea/testData/wordSelection/LabeledReturn/1.kt
@@ -0,0 +1,8 @@
+fun test(list: List) {
+ list.mapNotNull {
+ if (it == 0) {
+ return@mapNotNull null
+ }
+ it
+ }
+}
\ No newline at end of file
diff --git a/idea/testData/wordSelection/LabeledReturn/2.kt b/idea/testData/wordSelection/LabeledReturn/2.kt
new file mode 100644
index 00000000000..c0e897a8532
--- /dev/null
+++ b/idea/testData/wordSelection/LabeledReturn/2.kt
@@ -0,0 +1,8 @@
+fun test(list: List) {
+ list.mapNotNull {
+ if (it == 0) {
+ return@mapNotNull null
+ }
+ it
+ }
+}
\ No newline at end of file
diff --git a/idea/testData/wordSelection/LabeledReturn/3.kt b/idea/testData/wordSelection/LabeledReturn/3.kt
new file mode 100644
index 00000000000..594a5535fd3
--- /dev/null
+++ b/idea/testData/wordSelection/LabeledReturn/3.kt
@@ -0,0 +1,8 @@
+fun test(list: List) {
+ list.mapNotNull {
+ if (it == 0) {
+ return@mapNotNull null
+ }
+ it
+ }
+}
\ No newline at end of file
diff --git a/idea/tests/org/jetbrains/kotlin/idea/WordSelectionTest.java b/idea/tests/org/jetbrains/kotlin/idea/WordSelectionTest.java
index 5f9871fae31..6acecacd8b8 100644
--- a/idea/tests/org/jetbrains/kotlin/idea/WordSelectionTest.java
+++ b/idea/tests/org/jetbrains/kotlin/idea/WordSelectionTest.java
@@ -133,6 +133,8 @@ public class WordSelectionTest extends KotlinLightCodeInsightFixtureTestCase {
public void testLeftBrace() { doTest(); }
public void testRightBrace() { doTest(); }
+ public void testLabeledReturn() { doTest(); }
+
private void doTest() {
String dirName = getTestName(false);