#1914 Brie and Bocce

brian Sat 16 Jun 2012

Last month, I had a project over a couple of weekends to hack myself a new editor for my day to day work with Fantom. It was based on the basic idea that I often want all my navigation to be based on pods.

I have sort of designed this just for myself to work exactly how I want it to work. I've been using it as my main editor now for several weeks, but it is pretty rough around the edges, so I would not recommend anyone try to use it.

But the project has a couple of cool reusable components that others might find useful, so I went ahead and put the code up on BitBucket at https://bitbucket.org/brianfrank/brie

Two pieces others might find useful:

There is a pod called bocce which is a syntax color coded editor I wrote from scratch so I wouldn't be restricted by the SWT widget we use for fwt::RichText. The widget is just a Canvas which handles all its own keyboard/mouse input, editing commands, and painting. So it is easy to add all sorts of custom painting like highlighting find matches, etc. I might eventually pull this out and use for the text editor component in Flux. We might also eventually make it work in JavaScript for use in SkySpark.

I also have a bit of indexing code that runs in the background and parses the fcode in all your pod files to keep an in-memory model of all the pods, types, slots. It is way simpler than a live AST of what you are editing (it requires a compile to update). But it is super fast across a 100 pods and does pretty much all I need.

Login or Signup to reply.