How to detect if a class is implmenting a certain interface

For context, I’m making a plugin to make development for a thing a bit easier, and when a class implements an interface, how can I detect that and underline the class name (if the file in the resource dir does not contain the class), and to add it into there?

Hi,
I don’t fully understand your use case, but there are some pointers:

  1. To report a problem, implement a code inspection or an annotator.
  2. To check if a class implements an interface, use com.intellij.psi.util.InheritanceUtil#isInheritor(com.intellij.psi.PsiType, java.lang.String).
  3. To get a class’ directory, use com.intellij.psi.PsiElement#getContainingFile and com.intellij.psi.PsiFile#getParent.