Flatbuffers: Emacs mode for flatbuffers featuring syntax highlighting

Created on 13 Jun 2019  Â·  12Comments  Â·  Source: google/flatbuffers

Searching the internet I did not see any Emacs mode for flatbuffers which is often an indicator for the maturity of a library/language.

Is someone aware of an Emacs mode for flatbuffers, in particular to have syntax highlighting for "*.fbs" files?
If not, would it make sense to create one (happy to help)?

stale

Most helpful comment

@haifenghan check out this. It's not perfect, but I guess much better now. I figured it out, so it'll be complete soon. If you have any bugs, please open an issue in the flatbuffers-mode project. Thanks for the feedback!

All 12 comments

I've not heard of one, no. Maybe everyone is using https://marketplace.visualstudio.com/items?itemName=gaborv.flatbuffers instead? ;)
There's also https://plugins.jetbrains.com/plugin/8582-flatbuffers-support
Feel free to make one for emacs.. where would this normally be distributed?

I've not heard of one, no. Maybe everyone is using https://marketplace.visualstudio.com/items?itemName=gaborv.flatbuffers instead? ;)

sure Visual Studio Code is popular - but it's not the only editor :)

Feel free to make one for emacs.. where would this normally be distributed?

  • simplest way: add single file ".el" in flatbuffers repository (this is e.g. done by protobuf, see https://github.com/protocolbuffers/protobuf/blob/master/editors/protobuf-mode.el)
  • more elegant/official way: add to emacs package manager https://melpa.org

I will consider building a simple emacs mode for it (need to schedule some time for it)...

I also request a flatbuffer syntax file for Emacs.
Could you update it? Thanks

@jdees @haifenghan I hacked up something that can help you here
Please let me know if any issues! :)

@Asalle Thanks for your contribution. It seems good.

Hello @Asalle
When opening the file https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/schema/schema.fbs#L384

Some fields are shown in bule while others are not recognized. Is it the purpose?
Please see the following screenshot:

image

Hello @Asalle

Below is the corresponding part in Visual Code:

image

@haifenghan hey, I looked into that these 3 days and it's not very easy to fix. I'll need to write a regex for enums and learn some more elisp. I'll let you know if I'll come up with any solution. Pls report any other issues in "Issues" page of the flatbuffers-mode so we'll not spamming this thread.

Many thanks

@haifenghan check out this. It's not perfect, but I guess much better now. I figured it out, so it'll be complete soon. If you have any bugs, please open an issue in the flatbuffers-mode project. Thanks for the feedback!

This issue is stale because it has been open 6 months with no activity. Please comment or this will be closed in 14 days.

Was this page helpful?
0 / 5 - 0 ratings