In the last week I have worked on the initial version of a plain GTK3 editor with nimsuggest support:
http://ssalewski.de/tmp/NEd.png
It was easy and not much work, errors are underlined and messages are displayed as tooltip, method suggestions are available after user typed the period, and general word suggestions are available though GtkSourceView for the current file. It works generally really fine, unfortunately not really stable yet, filtering all invalid messages out from nimsuggest is not easy. Adding "go to definition" should be easy, other code we may steal from gedit or aporia...
Currently you can not compile the code, because a few tiny fixes for the GTK 3.20 wrapper are needed, I may apply these in the next weeks.
Very cool!
I hope you don't mind if I say this but the code looks a bit rough. It's all in a single file and there are many procedures which are far too large, for example: https://github.com/ngtk3/NEd/blob/master/src/ned.nim#L372. Are you planning on refactoring it in the future? It would be nice to offer this as an idiomatic Nim GTK3 example.
other code we may steal from gedit or aporia...
Be aware of licensing. Aporia is licensed under the GPLv2 (and gedit is too AFAIK). Your code is licensed under MIT, so I don't think you can simply copy code from those projects.
Are you planning on refactoring it in the future?
Yes, I may do that. Generally I consider the current code not as too ugly, casts and addr operations are reduced already to a minimum. My current main interest was investigation how extending of native GTK objects works, and how good GtkSourceView and nimsuggest works. Indeed the result was mostly positive. For GTK one problem is that there is nearly no public visible developer community. And nimsuggest has the problem of only tiny documentation and unstructured message passing which needs much filtering. I already suggested a more structured communication, maybe with JSON as you did in your chat example in your book.
Be aware of licensing.
Yes, that is a good point. I have preferred GPL for a long time and used MIT for GTK3 bindings and examples only because Nim used that license. I myself do generally no code copying, with the exception of a few lines, for example when API is not really documentated and one has to look into other peoples code to get the idea. Unfortunately that is the case sometimes for GTK. But maybe other people do indeed want to copy code from gedit or Aporia into this tool, so I think I should change license to GPL.
In the last days I made just for fun a dark color and syntax highlight scheme for GtkSourceView:
http://ssalewski.de/tmp/NEd-SHD.png
https://github.com/ngtk3/NEd/tree/master/src
It can be used for GEdit 3, maybe also for GVim and Aporia. Araq recently told me that multiline comments can be nested, so this scheme supports nesting. Of course this is the initial draft, it may need some tuning. I have done a short compare with the Aporia scheme, that one seems to be more sophisticated, but seems to contain some errors and is a bit complicated.