[MonoDevelop] Why MonoDevelop doesn't use GtkTextView/GtkSourceView?

Sébastien Wilmet swilmet at gnome.org
Sat Aug 23 18:03:42 UTC 2014


On Sat, Aug 23, 2014 at 06:58:35PM +0200, Mike Krüger wrote:
> It's very hard to bring all this kind of flexibility into a common API.

Some features don't always need a flexible API, just a property to
enable/disable the feature, and the library takes care of all the
details.

> >Do you have an example of a feature that uses a snapshot?
> Background parsing for example does that. Auto save is another. Generally
> IDE's are doing heavy background analysis these days.

Ok, indeed creating snapshots would be useful. I don't know if it would
be complicated to implement for GtkTextBuffer.

> Editors got reinvented more than twice - btw. other IDEs may use
> Mono.TextEditor as well :).
> btw. we may even choose to implement another front end for other UI
> libraries. I agree that reinventing the text editor isn't great - doing a
> text editor is a very huge task - but I do not see a real way around that
> because there are too many using scenarios.
> 
> - But - we can share data structure ideas / maybe even test suites and so
> on.

GtkTextView internals is documented here:
https://git.gnome.org/browse/gtk+/tree/docs/text_widget_internals.txt

> >What is the virtual indentation spaces?
> That's like smart indenting unlike it doesn't add the indent to the text.

Oh, looks great! Maybe the indentation could be added to the text, but
with a tag. When saving the file, the virtual indentation can be removed
thanks to the tag.

> >In summary, if you still remember how GtkTextView works, what should be
> >improved or changed in GtkTextView?
> It has been ~7 years last time I looked at it. Everything I knew about it
> may not be true anymore.
> But having a default folding implementation would be a good start for IDE
> use.

Well, I and other gedit developers don't really feel the need for the
code folding. I prefer to have the file structure (e.g. list of
functions) in a side panel. But it is planned to have a basic API in
GtkSourceView (to add/remove fold points, with a gutter component).

So apart from the lack of multi-threaded architecture (and maybe also
the snapshot), there is no fundamental problem with GtkTextView.

> The GtkSourceView search&replace was implemented with taking our
> implementation as example/concept.

(Just for the record, I think the UI of the incremental search in gedit
was inspired from MonoDevelop, indeed. But GtkSourceView contains only
the backend of the search and replace, it is a new API (not inspired by
other libraries), and the regex search was implemented entirely by
myself, I didn't look at the MonoDevelop code.)

--
Sébastien


More information about the Monodevelop-list mailing list