diff --git a/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/scopes/FirIdeNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated.java b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/scopes/FirIdeNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated.java index db06e3c43bb..a81397dd3cd 100644 --- a/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/scopes/FirIdeNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated.java +++ b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/scopes/FirIdeNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated.java @@ -64,12 +64,24 @@ public class FirIdeNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated ex runTest("analysis/analysis-api/testData/scopes/memberScopeByFqName/Int.kt"); } + @Test + @TestMetadata("javaField.kt") + public void testJavaField() throws Exception { + runTest("analysis/analysis-api/testData/scopes/memberScopeByFqName/javaField.kt"); + } + @Test @TestMetadata("javaFieldClash.kt") public void testJavaFieldClash() throws Exception { runTest("analysis/analysis-api/testData/scopes/memberScopeByFqName/javaFieldClash.kt"); } + @Test + @TestMetadata("javaMethods.kt") + public void testJavaMethods() throws Exception { + runTest("analysis/analysis-api/testData/scopes/memberScopeByFqName/javaMethods.kt"); + } + @Test @TestMetadata("java.lang.String.kt") public void testJava_lang_String() throws Exception { diff --git a/analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/scopes/FirStandaloneNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated.java b/analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/scopes/FirStandaloneNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated.java index c47092384a0..09e8c3c2d66 100644 --- a/analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/scopes/FirStandaloneNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated.java +++ b/analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/scopes/FirStandaloneNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated.java @@ -64,12 +64,24 @@ public class FirStandaloneNormalAnalysisSourceModuleMemberScopeByFqNameTestGener runTest("analysis/analysis-api/testData/scopes/memberScopeByFqName/Int.kt"); } + @Test + @TestMetadata("javaField.kt") + public void testJavaField() throws Exception { + runTest("analysis/analysis-api/testData/scopes/memberScopeByFqName/javaField.kt"); + } + @Test @TestMetadata("javaFieldClash.kt") public void testJavaFieldClash() throws Exception { runTest("analysis/analysis-api/testData/scopes/memberScopeByFqName/javaFieldClash.kt"); } + @Test + @TestMetadata("javaMethods.kt") + public void testJavaMethods() throws Exception { + runTest("analysis/analysis-api/testData/scopes/memberScopeByFqName/javaMethods.kt"); + } + @Test @TestMetadata("java.lang.String.kt") public void testJava_lang_String() throws Exception { diff --git a/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaField.kt b/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaField.kt new file mode 100644 index 00000000000..13eeb2cbb6c --- /dev/null +++ b/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaField.kt @@ -0,0 +1,8 @@ +// class: JavaClass +// FILE: main.kt + +// FILE: JavaClass.java +public class JavaClass { + public int field = 1; + public String field2 = "S"; +} diff --git a/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaField.pretty.txt b/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaField.pretty.txt new file mode 100644 index 00000000000..3459ce39385 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaField.pretty.txt @@ -0,0 +1,11 @@ +open var field: kotlin.Int + +open var field2: kotlin.String! + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String + +constructor() \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaField.txt b/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaField.txt new file mode 100644 index 00000000000..cf4d3b9639b --- /dev/null +++ b/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaField.txt @@ -0,0 +1,156 @@ +KtJavaFieldSymbol: + annotationsList: [] + callableIdIfNonLocal: /JavaClass.field + contextReceivers: [] + isExtension: false + isStatic: false + isVal: false + modality: OPEN + name: field + origin: JAVA + receiverType: null + returnType: kotlin/Int + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getDispatchReceiver(): JavaClass + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtJavaFieldSymbol: + annotationsList: [] + callableIdIfNonLocal: /JavaClass.field2 + contextReceivers: [] + isExtension: false + isStatic: false + isVal: false + modality: OPEN + name: field2 + origin: JAVA + receiverType: null + returnType: kotlin/String! + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getDispatchReceiver(): JavaClass + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: kotlin/Any.equals + contextReceivers: [] + hasStableParameterNames: true + isBuiltinFunctionInvoke: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: true + isOverride: false + isStatic: false + isSuspend: false + modality: OPEN + name: equals + origin: LIBRARY + receiverType: null + returnType: kotlin/Boolean + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [ + KtValueParameterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + generatedPrimaryConstructorProperty: null + hasDefaultValue: false + isCrossinline: false + isExtension: false + isImplicitLambdaParameter: false + isNoinline: false + isVararg: false + name: other + origin: LIBRARY + receiverType: null + returnType: kotlin/Any? + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtBinaryModule "Builtins for JVM (1.8)" + deprecationStatus: null + ] + visibility: Public + getDispatchReceiver(): kotlin/Any + getContainingModule: KtBinaryModule "Builtins for JVM (1.8)" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: kotlin/Any.hashCode + contextReceivers: [] + hasStableParameterNames: true + isBuiltinFunctionInvoke: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: false + isSuspend: false + modality: OPEN + name: hashCode + origin: LIBRARY + receiverType: null + returnType: kotlin/Int + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): kotlin/Any + getContainingModule: KtBinaryModule "Builtins for JVM (1.8)" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: kotlin/Any.toString + contextReceivers: [] + hasStableParameterNames: true + isBuiltinFunctionInvoke: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: false + isSuspend: false + modality: OPEN + name: toString + origin: LIBRARY + receiverType: null + returnType: kotlin/String + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): kotlin/Any + getContainingModule: KtBinaryModule "Builtins for JVM (1.8)" + deprecationStatus: null + +KtConstructorSymbol: + annotationsList: [] + callableIdIfNonLocal: null + containingClassIdIfNonLocal: JavaClass + contextReceivers: [] + hasStableParameterNames: false + isExtension: false + isPrimary: true + origin: JAVA + receiverType: null + returnType: JavaClass + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaMethods.kt b/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaMethods.kt new file mode 100644 index 00000000000..052475c9eed --- /dev/null +++ b/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaMethods.kt @@ -0,0 +1,17 @@ +// class: JavaClass +// FILE: main.kt + +// FILE: JavaClass.java +public class JavaClass { + public void foo() { + + } + + public String doo(int i) { + return ""; + } + + public String getStringValue() { + return ""; + } +} diff --git a/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaMethods.pretty.txt b/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaMethods.pretty.txt new file mode 100644 index 00000000000..bcd2716c1ad --- /dev/null +++ b/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaMethods.pretty.txt @@ -0,0 +1,13 @@ +open fun foo() + +open fun doo(i: kotlin.Int): kotlin.String! + +open fun getStringValue(): kotlin.String! + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String + +constructor() \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaMethods.txt b/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaMethods.txt new file mode 100644 index 00000000000..e740cba3d64 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/memberScopeByFqName/javaMethods.txt @@ -0,0 +1,219 @@ +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: /JavaClass.foo + contextReceivers: [] + hasStableParameterNames: false + isBuiltinFunctionInvoke: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: false + isSuspend: false + modality: OPEN + name: foo + origin: JAVA + receiverType: null + returnType: kotlin/Unit + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): JavaClass + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: /JavaClass.doo + contextReceivers: [] + hasStableParameterNames: false + isBuiltinFunctionInvoke: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: false + isSuspend: false + modality: OPEN + name: doo + origin: JAVA + receiverType: null + returnType: kotlin/String! + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [ + KtValueParameterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + generatedPrimaryConstructorProperty: null + hasDefaultValue: false + isCrossinline: false + isExtension: false + isImplicitLambdaParameter: false + isNoinline: false + isVararg: false + name: i + origin: JAVA + receiverType: null + returnType: kotlin/Int + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + ] + visibility: Public + getDispatchReceiver(): JavaClass + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: /JavaClass.getStringValue + contextReceivers: [] + hasStableParameterNames: false + isBuiltinFunctionInvoke: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: false + isSuspend: false + modality: OPEN + name: getStringValue + origin: JAVA + receiverType: null + returnType: kotlin/String! + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): JavaClass + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: kotlin/Any.equals + contextReceivers: [] + hasStableParameterNames: true + isBuiltinFunctionInvoke: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: true + isOverride: false + isStatic: false + isSuspend: false + modality: OPEN + name: equals + origin: LIBRARY + receiverType: null + returnType: kotlin/Boolean + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [ + KtValueParameterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + generatedPrimaryConstructorProperty: null + hasDefaultValue: false + isCrossinline: false + isExtension: false + isImplicitLambdaParameter: false + isNoinline: false + isVararg: false + name: other + origin: LIBRARY + receiverType: null + returnType: kotlin/Any? + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtBinaryModule "Builtins for JVM (1.8)" + deprecationStatus: null + ] + visibility: Public + getDispatchReceiver(): kotlin/Any + getContainingModule: KtBinaryModule "Builtins for JVM (1.8)" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: kotlin/Any.hashCode + contextReceivers: [] + hasStableParameterNames: true + isBuiltinFunctionInvoke: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: false + isSuspend: false + modality: OPEN + name: hashCode + origin: LIBRARY + receiverType: null + returnType: kotlin/Int + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): kotlin/Any + getContainingModule: KtBinaryModule "Builtins for JVM (1.8)" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: kotlin/Any.toString + contextReceivers: [] + hasStableParameterNames: true + isBuiltinFunctionInvoke: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: false + isSuspend: false + modality: OPEN + name: toString + origin: LIBRARY + receiverType: null + returnType: kotlin/String + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): kotlin/Any + getContainingModule: KtBinaryModule "Builtins for JVM (1.8)" + deprecationStatus: null + +KtConstructorSymbol: + annotationsList: [] + callableIdIfNonLocal: null + containingClassIdIfNonLocal: JavaClass + contextReceivers: [] + hasStableParameterNames: false + isExtension: false + isPrimary: true + origin: JAVA + receiverType: null + returnType: JavaClass + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null \ No newline at end of file