-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
74 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/GToolkit-Pharo-Coder-Method-UI/GtPharoHidingStyler.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
Class { | ||
#name : #GtPharoHidingStyler, | ||
#superclass : #GtGenericPharoStyler, | ||
#category : #'GToolkit-Pharo-Coder-Method-UI-Stylers' | ||
} | ||
|
||
{ #category : #'as yet unclassified' } | ||
GtPharoHidingStyler >> styleAssert: aMessage [ | ||
| messageMarker folder | | ||
((text attributesAt: aMessage startPosition - 1) | ||
anySatisfy: [ :each | each class == GtTextFolderAttribute ]) | ||
ifTrue: [ ^ self ]. | ||
messageMarker := BrTextInvisibleMarkerAttribute new. | ||
self | ||
attributes: {messageMarker} | ||
from: aMessage startPosition | ||
to: aMessage stopPosition. | ||
folder := GtTextFolderAttribute new attribute: messageMarker. | ||
self | ||
attribute: folder | ||
from: aMessage startPosition - 1 | ||
to: aMessage startPosition - 1. | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
GtPharoHidingStyler >> styleTimeDuring: aMessage [ | ||
| messageMarker folder | | ||
((text attributesAt: aMessage startPosition - 1) | ||
anySatisfy: [ :each | each class == GtTextFolderAttribute ]) | ||
ifTrue: [ ^ self ]. | ||
messageMarker := BrTextInvisibleMarkerAttribute new. | ||
self | ||
attributes: {messageMarker} | ||
from: aMessage startPosition | ||
to: aMessage message values second leftBracket position. | ||
self | ||
attributes: {messageMarker} | ||
from: aMessage message values second rightBracket position | ||
to: aMessage message values second rightBracket position. | ||
folder := GtTextFolderAttribute new attribute: messageMarker. | ||
self | ||
attribute: folder | ||
from: aMessage startPosition - 1 | ||
to: aMessage startPosition - 1 | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
GtPharoHidingStyler >> visitMessageSend: aMessageSend [ | ||
super visitMessageSend: aMessageSend. | ||
aMessageSend selector == #assert:description: ifTrue: [self styleAssert: aMessageSend]. | ||
aMessageSend selector == #time:during: ifTrue: [self styleTimeDuring: aMessageSend]. | ||
aMessageSend selector == #timeSync:during: ifTrue: [self styleTimeDuring: aMessageSend] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters