use of org.jetbrains.kotlin.psi.KtDeclaration in project kotlin by JetBrains.
the class KotlinStubsTest method testClassIsTrait.
public void testClassIsTrait() {
PsiFile psiFile = myFixture.configureByText("foo.kt", "interface Test { }");
List<KtDeclaration> declarations = ((KtFile) psiFile).getDeclarations();
KtClass ktClass = (KtClass) declarations.get(0);
KotlinClassStub stub = KtStubElementTypes.CLASS.createStub(ktClass, null);
assertEquals(true, stub.isInterface());
}
use of org.jetbrains.kotlin.psi.KtDeclaration in project kotlin by JetBrains.
the class DuplicateJvmSignatureAnnotator method annotate.
@Override
public void annotate(@NotNull PsiElement element, @NotNull AnnotationHolder holder) {
if (!(element instanceof KtFile) && !(element instanceof KtDeclaration))
return;
if (!ProjectRootsUtil.isInProjectSource(element))
return;
PsiFile file = element.getContainingFile();
if (!(file instanceof KtFile) || TargetPlatformDetector.getPlatform((KtFile) file) != JvmPlatform.INSTANCE)
return;
Diagnostics otherDiagnostics = ResolutionUtils.analyzeFully((KtElement) element).getDiagnostics();
GlobalSearchScope moduleScope = GetModuleInfoKt.getModuleInfo(element).contentScope();
Diagnostics diagnostics = DuplicateJvmSignatureUtilKt.getJvmSignatureDiagnostics(element, otherDiagnostics, moduleScope);
if (diagnostics == null)
return;
new KotlinPsiChecker().annotateElement(element, holder, diagnostics);
}
Aggregations