diff --git a/idea/testData/completion/handlers/KeywordFunctionName.kt b/idea/testData/completion/handlers/KeywordFunctionName.kt new file mode 100644 index 00000000000..d8423c85fbf --- /dev/null +++ b/idea/testData/completion/handlers/KeywordFunctionName.kt @@ -0,0 +1,7 @@ +package test + +fun `fun`(){} + +fun foo() { + +} diff --git a/idea/testData/completion/handlers/KeywordFunctionName.kt.after b/idea/testData/completion/handlers/KeywordFunctionName.kt.after new file mode 100644 index 00000000000..443e920693c --- /dev/null +++ b/idea/testData/completion/handlers/KeywordFunctionName.kt.after @@ -0,0 +1,7 @@ +package test + +fun `fun`(){} + +fun foo() { + `fun`() +} diff --git a/idea/testData/completion/handlers/smart/ClassObjectFieldKeywordName.kt b/idea/testData/completion/handlers/smart/ClassObjectFieldKeywordName.kt new file mode 100644 index 00000000000..a7412ac4f5f --- /dev/null +++ b/idea/testData/completion/handlers/smart/ClassObjectFieldKeywordName.kt @@ -0,0 +1,13 @@ +package `package` + +class `class` { + class object { + val `val` = `class`() + } +} + +fun foo(){ + val v: `class`= +} + +// ELEMENT: class.val diff --git a/idea/testData/completion/handlers/smart/ClassObjectFieldKeywordName.kt.after b/idea/testData/completion/handlers/smart/ClassObjectFieldKeywordName.kt.after new file mode 100644 index 00000000000..46abe9ef442 --- /dev/null +++ b/idea/testData/completion/handlers/smart/ClassObjectFieldKeywordName.kt.after @@ -0,0 +1,13 @@ +package `package` + +class `class` { + class object { + val `val` = `class`() + } +} + +fun foo(){ + val v: `class`= `class`.`val` +} + +// ELEMENT: class.val diff --git a/idea/testData/completion/handlers/smart/ConstructorWithKeywordName.kt b/idea/testData/completion/handlers/smart/ConstructorWithKeywordName.kt new file mode 100644 index 00000000000..25049789275 --- /dev/null +++ b/idea/testData/completion/handlers/smart/ConstructorWithKeywordName.kt @@ -0,0 +1,9 @@ +class `class` + +trait `trait` + +fun foo(p: `class`<`trait`>){} + +fun f(){ + foo() +} diff --git a/idea/testData/completion/handlers/smart/ConstructorWithKeywordName.kt.after b/idea/testData/completion/handlers/smart/ConstructorWithKeywordName.kt.after new file mode 100644 index 00000000000..d49d43bd168 --- /dev/null +++ b/idea/testData/completion/handlers/smart/ConstructorWithKeywordName.kt.after @@ -0,0 +1,9 @@ +class `class` + +trait `trait` + +fun foo(p: `class`<`trait`>){} + +fun f(){ + foo(`class`<`trait`>()) +} diff --git a/idea/tests/org/jetbrains/jet/completion/handlers/BasicCompletionHandlerTest.kt b/idea/tests/org/jetbrains/jet/completion/handlers/BasicCompletionHandlerTest.kt index f5e35916088..6145ce9fe11 100644 --- a/idea/tests/org/jetbrains/jet/completion/handlers/BasicCompletionHandlerTest.kt +++ b/idea/tests/org/jetbrains/jet/completion/handlers/BasicCompletionHandlerTest.kt @@ -149,4 +149,5 @@ public class BasicCompletionHandlerTest : CompletionHandlerTestBase(){ fun testTypeArgOfSuper() = doTest(1, "X", null, '\n') fun testKeywordClassName() = doTest(1, "class", null, '\n') + fun testKeywordFunctionName() = doTest(1, "fun", "fun()", null, '\n') } \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/completion/handlers/SmartCompletionHandlerTestGenerated.java b/idea/tests/org/jetbrains/jet/completion/handlers/SmartCompletionHandlerTestGenerated.java index 5e6cdbf8118..0a893d771fc 100644 --- a/idea/tests/org/jetbrains/jet/completion/handlers/SmartCompletionHandlerTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/completion/handlers/SmartCompletionHandlerTestGenerated.java @@ -98,6 +98,11 @@ public class SmartCompletionHandlerTestGenerated extends AbstractSmartCompletion doTest("idea/testData/completion/handlers/smart/ClassInObject.kt"); } + @TestMetadata("ClassObjectFieldKeywordName.kt") + public void testClassObjectFieldKeywordName() throws Exception { + doTest("idea/testData/completion/handlers/smart/ClassObjectFieldKeywordName.kt"); + } + @TestMetadata("ClassObjectMethod1.kt") public void testClassObjectMethod1() throws Exception { doTest("idea/testData/completion/handlers/smart/ClassObjectMethod1.kt"); @@ -218,6 +223,11 @@ public class SmartCompletionHandlerTestGenerated extends AbstractSmartCompletion doTest("idea/testData/completion/handlers/smart/ConstructorInsertsImport2.kt"); } + @TestMetadata("ConstructorWithKeywordName.kt") + public void testConstructorWithKeywordName() throws Exception { + doTest("idea/testData/completion/handlers/smart/ConstructorWithKeywordName.kt"); + } + @TestMetadata("ConstructorWithLambdaParameter1.kt") public void testConstructorWithLambdaParameter1() throws Exception { doTest("idea/testData/completion/handlers/smart/ConstructorWithLambdaParameter1.kt");