Administrator
|
I'm writing a little debugger extension and I want to replace the entire method source with another string.
I thought of two ways: aDebugger getTextMorph textMorph editor selectAll. aDebugger getTextMorph textMorph editor zapSelectionWith: aString. or aDebugger getTextMorph textMorph contents: 'meaning: aString meaning := aString.' aDebugger getTextMorph textMorph editor userHasEdited They both work, but what is the best/correct way to do something like this? Thanks!
Cheers,
Sean |
On 10 April 2013 20:08, Sean P. DeNigris <[hidden email]> wrote:
> I'm writing a little debugger extension and I want to replace the entire > method source with another string. > > I thought of two ways: > > aDebugger getTextMorph textMorph editor selectAll. > aDebugger getTextMorph textMorph editor zapSelectionWith: aString. > > or > > aDebugger getTextMorph textMorph contents: 'meaning: aString > meaning := aString.' > aDebugger getTextMorph textMorph editor userHasEdited > > They both work, but what is the best/correct way to do something like this? > > Thanks! > + 1 i wanna know that too. the problem with it, that the model is so diverse that you have no clue, which object is actually true holder (owner) of text, while others using it just for quick access. and also i don't like the expression length: aDebugger getTextMorph textMorph editor userHasEdited (poor guy, Demeter, and his law ;) ) it should not be like that.. (maybe we need to think about proper api there?) -- Best regards, Igor Stasenko. |
Administrator
|
In reply to this post by Sean P. DeNigris
Igor, couldn't agree more. Plus there are problems with both my approaches...
"Works if wrapped in "sourcePane handleEdit: []", but warns that the method has been edited elsewhere. Without the wrapping, it looks like it has accepted, but keeps the old source (i.e. when I browse the method, the source was not accepted). Warns that the method has been edited elsewhere; if you click okay, it looks like it has accepted, but keeps the old source (i.e. when I browse the method, the source was not accepted).
Cheers,
Sean |
In reply to this post by Igor Stasenko
Alain is rewriting textMorph so it will get better.
Then sean did you look at the new debugger model? Stef On Apr 10, 2013, at 8:38 PM, Igor Stasenko <[hidden email]> wrote: > On 10 April 2013 20:08, Sean P. DeNigris <[hidden email]> wrote: >> I'm writing a little debugger extension and I want to replace the entire >> method source with another string. >> >> I thought of two ways: >> >> aDebugger getTextMorph textMorph editor selectAll. >> aDebugger getTextMorph textMorph editor zapSelectionWith: aString. >> >> or >> >> aDebugger getTextMorph textMorph contents: 'meaning: aString >> meaning := aString.' >> aDebugger getTextMorph textMorph editor userHasEdited >> >> They both work, but what is the best/correct way to do something like this? >> >> Thanks! >> > > + 1 i wanna know that too. > the problem with it, that the model is so diverse that you have no > clue, which object is actually > true holder (owner) of text, while others using it just for quick access. > > and also i don't like the expression length: > aDebugger getTextMorph textMorph editor userHasEdited > > (poor guy, Demeter, and his law ;) ) > it should not be like that.. (maybe we need to think about proper api there?) > > > -- > Best regards, > Igor Stasenko. > |
In reply to this post by Sean P. DeNigris
I've spent some time in the past in that part of the debugger but still can't say which approach is better. Anyway, in the new debugger you can say: aDebugger code pendingText: 'something' Cheers, Andrei On Wed, Apr 10, 2013 at 9:24 PM, Sean P. DeNigris <[hidden email]> wrote: Igor, couldn't agree more. Plus there are problems with both my approaches... |
Administrator
|
In reply to this post by stephane ducasse
I want to use this in 2.0, so it seems I'm stuck with the old debugger for now.
Cheers,
Sean |
Free forum by Nabble | Edit this page |