private static boolean isJsonEditor(@NotNull Project project,
                                      @NotNull Editor editor) {
    final VirtualFile file = FileDocumentManager.getInstance().getFile(editor.getDocument());
    if (file == null) return false;
    final FileType fileType = file.getFileType();
    if (fileType instanceof JsonFileType) return true;
    if (!ScratchUtil.isScratch(file)) return false;
    return PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()) instanceof JsonFile;
  }
private static boolean isJsonEditor(@NotNull Project project,
                                      @NotNull Editor editor)