[Pharo5] Semantic Warnings as icons in the editor

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

[Pharo5] Semantic Warnings as icons in the editor

Marcus Denker-4
Hi,

One result of Friday’s Pharo Sprint in Chile: Use the nice icons of the new text editor
to display some of the semantic errors nicely (instead of breaking flow with a intrusive dialog):

This was done by Johan based on the prototype Miguel did in September:

1) unused temps:


(the “drag the crosshair”r is an artefact of the snapshot tool)

2) temps used that are not initialised:



In a next step, we need to integrate that with the QA tool… no need to have this reported
twice.

What is nice is that this simplified the Compiler: instead of having an Exception and raising
it, we now just annotate the AST:

unusedVariable: variableNode

variableNode propertyAt: #semanticWarning put: 'unused variable’

(this is very simple for now, with a node just being able to have one kind of semanticWarning).

SemanticWarningIconStyler is what adds the icon. It has 4 methods with one line each.

Marcus

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] [Pharo5] Semantic Warnings as icons in the editor

Tudor Girba-2
Very nice!

Doru


> On Nov 28, 2015, at 11:01 PM, Marcus Denker <[hidden email]> wrote:
>
> Hi,
>
> One result of Friday’s Pharo Sprint in Chile: Use the nice icons of the new text editor
> to display some of the semantic errors nicely (instead of breaking flow with a intrusive dialog):
>
> This was done by Johan based on the prototype Miguel did in September:
>
> 1) unused temps:
>
> <unused.png>
>
> (the “drag the crosshair”r is an artefact of the snapshot tool)
>
> 2) temps used that are not initialised:
>
> <uninit.png>
>
>
> In a next step, we need to integrate that with the QA tool… no need to have this reported
> twice.
>
> What is nice is that this simplified the Compiler: instead of having an Exception and raising
> it, we now just annotate the AST:
>
> unusedVariable: variableNode
>
> variableNode propertyAt: #semanticWarning put: 'unused variable’
>
> (this is very simple for now, with a node just being able to have one kind of semanticWarning).
>
> SemanticWarningIconStyler is what adds the icon. It has 4 methods with one line each.
>
> Marcus
>

--
www.tudorgirba.com

"Value is always contextual."




Reply | Threaded
Open this post in threaded view
|

Re: [Pharo5] Semantic Warnings as icons in the editor

stepharo
In reply to this post by Marcus Denker-4
I'm happy to see all the pieces coming together. It was thinking about it that we worked with frank and alain on putting rubric in place and now it pays off :).

Stef

Le 28/11/15 23:01, Marcus Denker a écrit :
Hi,

One result of Friday’s Pharo Sprint in Chile: Use the nice icons of the new text editor
to display some of the semantic errors nicely (instead of breaking flow with a intrusive dialog):

This was done by Johan based on the prototype Miguel did in September:

1) unused temps:


(the “drag the crosshair”r is an artefact of the snapshot tool)

2) temps used that are not initialised:



In a next step, we need to integrate that with the QA tool… no need to have this reported
twice.

What is nice is that this simplified the Compiler: instead of having an Exception and raising
it, we now just annotate the AST:

unusedVariable: variableNode

variableNode propertyAt: #semanticWarning put: 'unused variable’

(this is very simple for now, with a node just being able to have one kind of semanticWarning).

SemanticWarningIconStyler is what adds the icon. It has 4 methods with one line each.

Marcus