@Override
  public @Nullable RefactoringElementListener getListener(PsiElement element) {
    if (element == null) {
      return null;
    }
    final VirtualFile oldFile = PsiUtilBase.asVirtualFile(element);
    if (oldFile == null || !(oldFile.getFileType() instanceof LanguageFileType) ||
      !(((LanguageFileType)oldFile.getFileType()).getLanguage().isKindOf(JsonLanguage.INSTANCE))) {
      return null;
    }
    final Project project = element.getProject();
    if (project.getBaseDir() == null) return null;

    final String oldRelativePath = VfsUtilCore.getRelativePath(oldFile, project.getBaseDir());
    if (oldRelativePath != null) {
      final JsonSchemaMappingsProjectConfiguration configuration = JsonSchemaMappingsProjectConfiguration.getInstance(project);
      return new UndoRefactoringElementAdapter() {
        @Override
        protected void refactored(@NotNull PsiElement element, @Nullable String oldQualifiedName) {
          final VirtualFile newFile = PsiUtilBase.asVirtualFile(element);
          if (newFile != null) {
            final String newRelativePath = VfsUtilCore.getRelativePath(newFile, project.getBaseDir());
            if (newRelativePath != null) {
              configuration.schemaFileMoved(project, oldRelativePath, newRelativePath);
            }
          }
        }
      };
    }
    return null;
  }
@Override
  public @Nullable RefactoringElementListener getListener(PsiElement element)