Smalltalk syntactic coloration in Spec's TextModel

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Smalltalk syntactic coloration in Spec's TextModel

Julien Delplanque
Hello,

I looked in the mailing list archive but did not found an answer.

Is there any way to have Smalltalk syntactic coloration in a TextModel
without having to put efforts in it?

I mean, if I do:

TextModel new
     isForSmalltalkCode: true;
     text: (Collection>>#any) sourceCode;
     openWithSpec

The text displayed is black.

Thanks in advance,

Julien


Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk syntactic coloration in Spec's TextModel

Nicolai Hess-3-2


2017-05-03 16:57 GMT+02:00 Julien Delplanque <[hidden email]>:
Hello,

I looked in the mailing list archive but did not found an answer.

Is there any way to have Smalltalk syntactic coloration in a TextModel
without having to put efforts in it?

I mean, if I do:

TextModel new
    isForSmalltalkCode: true;
    text: (Collection>>#any) sourceCode;
    openWithSpec

The text displayed is black.

Thanks in advance,

Julien



Hi,
you need to add
aboutToStyle:true



TextModel new
    isForSmalltalkCode: true;
    text: (Collection>>#anyOne) sourceCode;
    aboutToStyle: true;
    openWithSpec

Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk syntactic coloration in Spec's TextModel

Julien Delplanque
Thanks, it works.

Another question: Is it possible to manage the fact that the
code displayed is a method? (ie not having the selector and
instance variables causing the syntactic coloration to be
red)

Thanks in advance,

Julien


On 03/05/17 17:09, Nicolai Hess wrote:

> 2017-05-03 16:57 GMT+02:00 Julien Delplanque <[hidden email]>:
>
>> Hello,
>>
>> I looked in the mailing list archive but did not found an answer.
>>
>> Is there any way to have Smalltalk syntactic coloration in a TextModel
>> without having to put efforts in it?
>>
>> I mean, if I do:
>>
>> TextModel new
>>      isForSmalltalkCode: true;
>>      text: (Collection>>#any) sourceCode;
>>      openWithSpec
>>
>> The text displayed is black.
>>
>> Thanks in advance,
>>
>> Julien
>>
>>
>>
> Hi,
> you need to add
> aboutToStyle:true
>
>
>
> TextModel new
>      isForSmalltalkCode: true;
>      text: (Collection>>#anyOne) sourceCode;
>      aboutToStyle: true;
>      openWithSpec
>


Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk syntactic coloration in Spec's TextModel

Nicolai Hess-3-2


2017-05-04 12:53 GMT+02:00 Julien Delplanque <[hidden email]>:
Thanks, it works.

Another question: Is it possible to manage the fact that the
code displayed is a method? (ie not having the selector and
instance variables causing the syntactic coloration to be
red)

Yes, setting the behavior (class of the method):

TextModel new
    isForSmalltalkCode: true;
    text: (Collection>>#anyOne) sourceCode;
    aboutToStyle: true;
    behavior: (Collection>>#anyOne) methodClass;
    openWithSpec
 

Thanks in advance,

Julien



On 03/05/17 17:09, Nicolai Hess wrote:
2017-05-03 16:57 GMT+02:00 Julien Delplanque <[hidden email]>:

Hello,

I looked in the mailing list archive but did not found an answer.

Is there any way to have Smalltalk syntactic coloration in a TextModel
without having to put efforts in it?

I mean, if I do:

TextModel new
     isForSmalltalkCode: true;
     text: (Collection>>#any) sourceCode;
     openWithSpec

The text displayed is black.

Thanks in advance,

Julien



Hi,
you need to add
aboutToStyle:true



TextModel new
     isForSmalltalkCode: true;
     text: (Collection>>#anyOne) sourceCode;
     aboutToStyle: true;
     openWithSpec




Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk syntactic coloration in Spec's TextModel

Stephan Eggermont-3
In reply to this post by Nicolai Hess-3-2
On 03/05/17 17:09, Nicolai Hess wrote:
> you need to add
> aboutToStyle:true

That is an ahem, 'interesting' selector.

Stephan



Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk syntactic coloration in Spec's TextModel

Julien Delplanque
In reply to this post by Nicolai Hess-3-2
Thanks, it works perfectly.

Julien


On 04/05/17 13:11, Nicolai Hess wrote:

> 2017-05-04 12:53 GMT+02:00 Julien Delplanque <[hidden email]>:
>
>> Thanks, it works.
>>
>> Another question: Is it possible to manage the fact that the
>> code displayed is a method? (ie not having the selector and
>> instance variables causing the syntactic coloration to be
>> red)
>>
> Yes, setting the behavior (class of the method):
>
> TextModel new
>      isForSmalltalkCode: true;
>      text: (Collection>>#anyOne) sourceCode;
>      aboutToStyle: true;
>      behavior: (Collection>>#anyOne) methodClass;
>      openWithSpec
>
>
>> Thanks in advance,
>>
>> Julien
>>
>>
>>
>> On 03/05/17 17:09, Nicolai Hess wrote:
>>
>>> 2017-05-03 16:57 GMT+02:00 Julien Delplanque <[hidden email]>:
>>>
>>> Hello,
>>>> I looked in the mailing list archive but did not found an answer.
>>>>
>>>> Is there any way to have Smalltalk syntactic coloration in a TextModel
>>>> without having to put efforts in it?
>>>>
>>>> I mean, if I do:
>>>>
>>>> TextModel new
>>>>       isForSmalltalkCode: true;
>>>>       text: (Collection>>#any) sourceCode;
>>>>       openWithSpec
>>>>
>>>> The text displayed is black.
>>>>
>>>> Thanks in advance,
>>>>
>>>> Julien
>>>>
>>>>
>>>>
>>>> Hi,
>>> you need to add
>>> aboutToStyle:true
>>>
>>>
>>>
>>> TextModel new
>>>       isForSmalltalkCode: true;
>>>       text: (Collection>>#anyOne) sourceCode;
>>>       aboutToStyle: true;
>>>       openWithSpec
>>>
>>>
>>