1

I noticed there is no library listed in melpa for highlighting and working with Apache Avro IDL schemata. Is there any, or else how people who work with Avro have set up their configuration to ease their work?

dmvianna
  • 392
  • 4
  • 21
  • "how people who work with avro have set up their configuration to ease their work" is too broad. This site is more about specific how-to questions. Maybe you want to ask simply how to get syntax highlighting for avro files? – Drew Aug 09 '21 at 02:47
  • @Drew That is correct. However I’m definitely open to more encompassing answers. – dmvianna Aug 09 '21 at 03:24
  • 1
    It would help if you provided a description (and maybe some links) to what avro is. I googled it and the first hit says: " It uses JSON for defining data types and protocols...", so does a JSON library satisfy your requirements? If so, there should be plenty to choose from. – NickD Aug 09 '21 at 13:35
  • 1
    @NickD As I became more knowledgeable on the subject I was able to formulate a more precise question. I changed the wording and included a link to the specification. – dmvianna Aug 11 '21 at 13:14

1 Answers1

1

I couldn't find anything, so I made it myself.

;;; avro-mode.el -- major mode for editing Avro IDL files. -*- coding: utf-8; lexical-binding: t; -*-

;;; Copyright © by Daniel Vianna ;;; Version: 0.0.1 ;;; Created: 19 Aug 2021

;;; Keywords: languages

;;; This file is not part of GNU Emacs.

;;; License:

;;; You can redistribute this program and/or modify it under the terms of the GNU General Public License version 2.

;;; Package --- summary ;;; Commentary: ;;; ;;; Avro interface description language mode (.avdl) ;;; Code:

(require 'generic-x)

(define-generic-mode 'avro-mode '("//") ;; comments '("protocol" "namespace") ;; reserved words '(("\<[[:alnum:]]+\>" (0 font-lock-builtin-face) ("\<[[:alnum:]]+\>;?\( {\)?" nil nil (0 nil))) ;; type ("\<\(?:namespace\|protocol\)\>" . font-lock-keyword-face)

(&quot;{\\|}\\|;\\|&lt;\\|&gt;&quot; . font-lock-constant-face)) ;; separators

'("\.avdl$") ;; file extension nil "Major mode for editing Avro IDL files." )

(provide 'avro-mode)

;;; avro-mode.el ends here

dmvianna
  • 392
  • 4
  • 21