Non-imported extension functions and properties in smart completion + adding import on completing of non-imported property

This commit is contained in:
Valentin Kipyatkov
2014-09-16 15:35:22 +04:00
parent 507bfe49aa
commit 75f7f296aa
23 changed files with 304 additions and 133 deletions
@@ -22,7 +22,11 @@ import org.jetbrains.jet.plugin.PluginTestCaseBase;
import java.io.File;
public class CompletionMultifileHandlerTest extends KotlinCompletionTestCase {
public void testExtensionFunctions() throws Exception {
public void testExtensionFunctionImport() throws Exception {
doTest();
}
public void testExtensionPropertyImport() throws Exception {
doTest();
}
@@ -42,6 +46,10 @@ public class CompletionMultifileHandlerTest extends KotlinCompletionTestCase {
doTest();
}
public void testTopLevelPropertyImport() throws Exception {
doTest();
}
public void testNoParenthesisInImports() throws Exception {
doTest();
}
@@ -0,0 +1,52 @@
/*
* Copyright 2010-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.jet.completion.handlers;
import com.intellij.codeInsight.completion.CompletionType;
import org.jetbrains.jet.plugin.KotlinCompletionTestCase;
import org.jetbrains.jet.plugin.PluginTestCaseBase;
import java.io.File;
public class SmartCompletionMultifileHandlerTest extends KotlinCompletionTestCase {
public void testImportExtensionFunction() throws Exception {
doTest();
}
public void testImportExtensionProperty() throws Exception {
doTest();
}
@Override
protected void setUp() throws Exception {
setType(CompletionType.SMART);
super.setUp();
}
public void doTest() throws Exception {
String fileName = getTestName(false);
configureByFiles(null, fileName + "-1.kt", fileName + "-2.kt");
complete(1);
checkResultByFile(fileName + ".kt.after");
}
@Override
protected String getTestDataPath() {
return new File(PluginTestCaseBase.getTestDataPathBase(), "/completion/handlers/multifile/smart/").getPath() + File.separator;
}
}