[NI] Implement algorithm for completion mode selection
Current selection of completion mode for call is not always correct in case of full mode, and sometimes too conservative in case of partial mode. Updated algorithm checks constraints wrt position of type variables in return type and in other related constraints. Full completion happens if proper constraint requirements are satisfied for variables.
This commit is contained in:
@@ -10369,6 +10369,39 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/inference/completion")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Completion extends AbstractDiagnosticsTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInCompletion() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/inference/completion"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("basic.kt")
|
||||
public void testBasic() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/completion/basic.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt33166.kt")
|
||||
public void testKt33166() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/completion/kt33166.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("partialForIlt.kt")
|
||||
public void testPartialForIlt() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/completion/partialForIlt.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("withExact.kt")
|
||||
public void testWithExact() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/completion/withExact.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/inference/constraints")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Generated
+33
@@ -10364,6 +10364,39 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/inference/completion")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Completion extends AbstractDiagnosticsUsingJavacTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInCompletion() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/inference/completion"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("basic.kt")
|
||||
public void testBasic() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/completion/basic.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt33166.kt")
|
||||
public void testKt33166() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/completion/kt33166.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("partialForIlt.kt")
|
||||
public void testPartialForIlt() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/completion/partialForIlt.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("withExact.kt")
|
||||
public void testWithExact() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/completion/withExact.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/inference/constraints")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user