SHRBTextStyler and workspace/playground variables

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

SHRBTextStyler and workspace/playground variables

Andrei Chis
Hi,

Currently SHRBTextStyler does not highlight variables in the playground.
This could be added by extending SHRBTextStyler >>#resolveStyleFor: with 

workspace
ifNotNil: [(workspace hasBindingOf: aVariableNode name)
ifTrue: [^ #workspaceVar]].

Still this could cause some problems given how MorphicTextAdapter integrates Rubric.

MorphicTextAdapter>>setEditingModeFor:withBehavior: can translate #beForCode from Spec to #beForSmalltalkScripting in Rubric.
However for #beForSmalltalkScripting  to work the model has to provide methods for managing bindings which MorphicTextAdapter does not.

Maybe there is another way to highlight variables in the playground.

Cheers,
Andrei
Reply | Threaded
Open this post in threaded view
|

Re: SHRBTextStyler and workspace/playground variables

Nicolai Hess


2015-09-24 12:06 GMT+02:00 Andrei Chis <[hidden email]>:
Hi,

Currently SHRBTextStyler does not highlight variables in the playground.
This could be added by extending SHRBTextStyler >>#resolveStyleFor: with 

workspace
ifNotNil: [(workspace hasBindingOf: aVariableNode name)
ifTrue: [^ #workspaceVar]].

Yes, I  tried it already, but I couldn't get it to work.
I would like to have some way to add this to the semantic analyser step.
If the workspace is defined as a requestore scope, the variable analysis
should work the same way as if we actual  "compile" the code.

 

Still this could cause some problems given how MorphicTextAdapter integrates Rubric.

MorphicTextAdapter>>setEditingModeFor:withBehavior: can translate #beForCode from Spec to #beForSmalltalkScripting in Rubric.
However for #beForSmalltalkScripting  to work the model has to provide methods for managing bindings which MorphicTextAdapter does not.


This is really difficult, especially because the actual model is different for Nautilus code panes and of course any spec based text/code model.
 
Maybe there is another way to highlight variables in the playground.

Cheers,
Andrei

Reply | Threaded
Open this post in threaded view
|

Re: SHRBTextStyler and workspace/playground variables

Marcus Denker-4

On 25 Sep 2015, at 08:58, Nicolai Hess <[hidden email]> wrote:



2015-09-24 12:06 GMT+02:00 Andrei Chis <[hidden email]>:
Hi,

Currently SHRBTextStyler does not highlight variables in the playground.
This could be added by extending SHRBTextStyler >>#resolveStyleFor: with 

workspace
ifNotNil: [(workspace hasBindingOf: aVariableNode name)
ifTrue: [^ #workspaceVar]].

Yes, I  tried it already, but I couldn't get it to work.
I would like to have some way to add this to the semantic analyser step.
If the workspace is defined as a requestore scope, the variable analysis
should work the same way as if we actual  "compile" the code.

 

Still this could cause some problems given how MorphicTextAdapter integrates Rubric.

MorphicTextAdapter>>setEditingModeFor:withBehavior: can translate #beForCode from Spec to #beForSmalltalkScripting in Rubric.
However for #beForSmalltalkScripting  to work the model has to provide methods for managing bindings which MorphicTextAdapter does not.


This is really difficult, especially because the actual model is different for Nautilus code panes and of course any spec based text/code model.

Yes, we really need to put some work into having a unified model behind all our tools… it’s getting very hard to do anything how it is now.

Marcus

Reply | Threaded
Open this post in threaded view
|

Re: SHRBTextStyler and workspace/playground variables

Andrei Chis
In reply to this post by Nicolai Hess


On Fri, Sep 25, 2015 at 8:58 AM, Nicolai Hess <[hidden email]> wrote:


2015-09-24 12:06 GMT+02:00 Andrei Chis <[hidden email]>:
Hi,

Currently SHRBTextStyler does not highlight variables in the playground.
This could be added by extending SHRBTextStyler >>#resolveStyleFor: with 

workspace
ifNotNil: [(workspace hasBindingOf: aVariableNode name)
ifTrue: [^ #workspaceVar]].

Yes, I  tried it already, but I couldn't get it to work.
I would like to have some way to add this to the semantic analyser step.
If the workspace is defined as a requestore scope, the variable analysis
should work the same way as if we actual  "compile" the code.

I also think this would be a much nicer solution. I looked a bit at the how requestor scopes 
work but it's not that clear how to add the workspace as a scope.
 

Cheers,
Andrei


 

Still this could cause some problems given how MorphicTextAdapter integrates Rubric.

MorphicTextAdapter>>setEditingModeFor:withBehavior: can translate #beForCode from Spec to #beForSmalltalkScripting in Rubric.
However for #beForSmalltalkScripting  to work the model has to provide methods for managing bindings which MorphicTextAdapter does not.


This is really difficult, especially because the actual model is different for Nautilus code panes and of course any spec based text/code model.
 
Maybe there is another way to highlight variables in the playground.

Cheers,
Andrei


Reply | Threaded
Open this post in threaded view
|

Re: SHRBTextStyler and workspace/playground variables

Marcus Denker-4

On 25 Sep 2015, at 11:10, Andrei Chis <[hidden email]> wrote:



On Fri, Sep 25, 2015 at 8:58 AM, Nicolai Hess <[hidden email]> wrote:


2015-09-24 12:06 GMT+02:00 Andrei Chis <[hidden email]>:
Hi,

Currently SHRBTextStyler does not highlight variables in the playground.
This could be added by extending SHRBTextStyler >>#resolveStyleFor: with 

workspace
ifNotNil: [(workspace hasBindingOf: aVariableNode name)
ifTrue: [^ #workspaceVar]].

Yes, I  tried it already, but I couldn't get it to work.
I would like to have some way to add this to the semantic analyser step.
If the workspace is defined as a requestore scope, the variable analysis
should work the same way as if we actual  "compile" the code.

I also think this would be a much nicer solution. I looked a bit at the how requestor scopes 
work but it's not that clear how to add the workspace as a scope.
 


That actually is what needs to be done… it is on my TODO… 

Marcus