public static @NotNull Language getLanguageOrDefaultJson(@NotNull PsiElement element) {
    PsiFile file = element.getContainingFile();
    if (file != null) {
      Language language = file.getLanguage();
      if (language instanceof JsonLanguage) return language;
    }
    return ObjectUtils.coalesce(ObjectUtils.tryCast(element.getLanguage(), JsonLanguage.class), JsonLanguage.INSTANCE);
  }
public static @NotNull Language getLanguageOrDefaultJson(@NotNull PsiElement element)