[MonoDevelop] SourceEditor: ideas

John Luke john.luke@gmail.com
Tue, 01 Mar 2005 18:46:32 -0500


On Wed, 2005-03-02 at 00:03 +0100, Ben Motmans wrote:
>On Tue, 01 Mar 2005 17:39:07 -0500, John Luke <john.luke@gmail.com> wrote:
>> I don't know about others, but I would have preferred a plain-text mail
>> with image attachments if necessary for this sort of thing.
>> It makes it a lot easier to quote.
>> 
>
>yeah, sorry
>my plan was to post it on the MD wiki, but there seems to be a problem
>with registering a new user
>
>> I am not sure that you understand that the current editor has the
>> ability to support most of what you want added.  In fact, there is
>> an existing parser for C# that can be used for error underlining,
>> refactoring, highlighting etc. Some of these are already implemented
>> but not quite ready to be enabled.  I think identifying more of what you
>> view as the problem currently would help here.
>> 
>
>i am aware of those things, but there are several problems with the
>existing code
>
>GtkSourceView:
>- it is very difficult (it's actually an ugly hack) to create extra
>rulers (for example code folding)
>- Although it has the ability to highlight the current line, you
>cannot highlight multiple lines (completely, not the bg color of some
>text), this would be very usefull for a diff viewer, ...
>- end of line handing, \n <> \r\n <> \r
>- small issues like, double clicking "doMD5" will only select "doMD"
>- customizable right-click menu
>- ...
>

Yes, this is much better (and I have some more things to add at some
point).  Some things are in bugzilla, some of these maybe should be.

>Refactoring:
>- I'm not saying we should re-invent the wheel, it's just an idea i
>was having to integrate the refactoring code more in the text editor
>(actually, not in the text editor, but a layer on the textbuffer or
>something like that)
>- existing SD code doesn't have C# 2.0 support (again, not
>re-inventing, just adding :))
>

I was just kind of cautioning you against confusing the base texteditor
infrastucture with parsing/other related features that would likely be
agnostic to an editor.  For example, C# 2 support is irrelevent here but
easy access to the document structure for refactoring isn't (and
something I agree we need).

>> Also, you may not be aware of the previous port of the SharpDevelop
>> texteditor which did many of these things in only C# code and the
>> related discussion that happened when we moved from that one to the
>> current gtksourceview-based one.
>> 
>> The main issue with the current approach, in my opinion, is limitations
>> by having mixed c/C# code to do these things.  So I would recommend
>> a first approach is to either port gtksourceview to C# on top of
>> Gtk.TextView or revive the old port of the SharpDevelop editor.  At the
>> point
>> where either of those is done it would make sense to talk about moving
>> on from there.
>> 
>
>indeed, i'm not aware of previous porting (i'm following MD
>development for only 1-2 months, i don't know anything about what
>happened before)
>
>probably, i didn't make it clear enough, this is nothing more then
>information gathering
>making a list of everything that should be in good source editor, and
>afterwards decide what could be done
>

Ok, I was just trying to help you in gathering information while
recommending a course of action that is reasonable (i.e. where to look
archives & code).  Much of this was previously discussed in some detail
and some of us have already formed opinions on what is the best way to
go.

Keep in mind it is just my opinion after all.