Complete private members from libraries in Evaluate Expression dialog

This commit is contained in:
Natalia Ukhorskaya
2016-03-14 18:31:59 +03:00
parent 26c153639a
commit b79aa13242
5 changed files with 22 additions and 1 deletions
+1
View File
@@ -23,3 +23,4 @@
### IDE
- Debugger can distinguish nested inline arguments
- Add kotlinClassName() and kotlinFunctionName() macros for use in live templates
- Complete private members from libraries in Evaluate Expression dialog
@@ -191,7 +191,7 @@ abstract class CompletionSession(
if (descriptor is DeclarationDescriptorWithVisibility) {
val visible = descriptor.isVisible(position, callTypeAndReceiver.receiver as? KtExpression, bindingContext, resolutionFacade)
if (visible) return true
return completeNonAccessible && !descriptor.isFromLibrary()
return completeNonAccessible && (!descriptor.isFromLibrary() || file is KtCodeFragment)
}
return true
@@ -0,0 +1,13 @@
import java.io.File
class MyFile : File("file") {
private val privateField = 0
}
fun foo(f: MyFile) {
val a = 1<caret>
}
// INVOCATION_COUNT: 2
// EXIST: privateField
// EXIST: prefixLength
@@ -83,6 +83,12 @@ public class CodeFragmentCompletionTestGenerated extends AbstractCodeFragmentCom
doTest(fileName);
}
@TestMetadata("privatesInSecondPressCompletion.kt")
public void testPrivatesInSecondPressCompletion() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/codeFragments/privatesInSecondPressCompletion.kt");
doTest(fileName);
}
@TestMetadata("topLevel.kt")
public void testTopLevel() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/codeFragments/topLevel.kt");