Load additional JDK functions into built-ins member scope

#KT-5990 Fixed
 #KT-7127 Fixed
 #KT-10370 Fixed
This commit is contained in:
Denis Zharkov
2016-04-06 16:35:50 +03:00
parent 137847e0c9
commit 5bc5722051
63 changed files with 3395 additions and 147 deletions
@@ -0,0 +1,7 @@
fun foo(x: MutableList<String>) {
x.<caret>
}
// EXIST: {"lookupString":"stream","tailText":"()","typeText":"Stream<String!>!"}
// EXIST: {"lookupString":"removeIf","tailText":"(Predicate<in String!>!)","typeText":"Boolean"}
// EXIST: {"lookupString":"removeIf","tailText":" {...} (((String!) -> Boolean)!)","typeText":"Boolean"}
@@ -0,0 +1,7 @@
fun foo(x: List<String>) {
x.stream().<caret>
}
// EXIST: {"lookupString":"allMatch","tailText":" {...} (((String!) -> Boolean)!)","typeText":"Boolean","attributes":"bold"}
// EXIST: {"lookupString":"allMatch","tailText":"(Predicate<in String!>!)","typeText":"Boolean","attributes":"bold"}
// EXIST: {"lookupString":"count","tailText":"()","typeText":"Long","attributes":"bold"}
@@ -0,0 +1,29 @@
/*
* Copyright 2010-2016 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.kotlin.idea.completion.test;
import com.intellij.testFramework.LightProjectDescriptor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor;
public abstract class AbstractJava8BasicCompletionTest extends AbstractJvmBasicCompletionTest {
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE_FULL_JDK;
}
}
@@ -0,0 +1,49 @@
/*
* Copyright 2010-2016 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.kotlin.idea.completion.test;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
import org.jetbrains.kotlin.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.runner.RunWith;
import java.io.File;
import java.util.regex.Pattern;
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("idea/idea-completion/testData/basic/java8")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public class Java8BasicCompletionTestGenerated extends AbstractJava8BasicCompletionTest {
public void testAllFilesPresentInJava8() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/idea-completion/testData/basic/java8"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("CollectionMethods.kt")
public void testCollectionMethods() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/java8/CollectionMethods.kt");
doTest(fileName);
}
@TestMetadata("StreamMethods.kt")
public void testStreamMethods() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/java8/StreamMethods.kt");
doTest(fileName);
}
}