Skip to content

Commit

Permalink
add helpfull methods
Browse files Browse the repository at this point in the history
  • Loading branch information
badetitou committed Mar 26, 2019
1 parent f63f433 commit 43a99f1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/FAST-Core-Model-Extension/FASTEntity.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ FASTEntity >> containers [
FASTEntity >> parentNode [
^ self containers at: 1 ifAbsent: [ nil ]
]

{ #category : #'*FAST-Core-Model-Extension' }
FASTEntity >> removeAllPotentialParentNode [
^ self parentSelectors do: [:selector | self perform: selector, ':' withArguments: { nil } ].
]
28 changes: 28 additions & 0 deletions src/FAST-GTExtensions/FASTEntitySourceAnchor.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Extension { #name : #FASTEntitySourceAnchor }

{ #category : #'*FAST-GTExtensions' }
FASTEntitySourceAnchor >> gtNodesIn: composite [
<gtInspectorPresentationOrder: 0>
^ composite tree
title: 'Tree';
display: [ :anObject | anObject ];
children: [ :each | each childrenNode ];
yourself
]

{ #category : #'*FAST-GTExtensions' }
FASTEntitySourceAnchor >> gtSourceCodeIn: composite [
<gtInspectorPresentationOrder: 0>
^ composite text
title: 'Source code';
display: [ self ];
format: [ :t | self sourceText ifNil: [ 'No source code available' ] ifNotNil: [ self sourceCodeAsText ] ];
withLineNumbers: true;
initialize: [ :presentation | (self sourceText isNil or: [ self startPos isNil or: [ self endPos isNil ] ]) ifFalse: [ presentation selectionInterval: (self startPos to: self endPos) ] ];
yourself
]

{ #category : #'*FAST-GTExtensions' }
FASTEntitySourceAnchor >> sourceCodeAsText [
^ self sourceText asText
]

0 comments on commit 43a99f1

Please sign in to comment.