Skip to content

Commit

Permalink
Add inspector tabs on source anchors + simplify some extensions
Browse files Browse the repository at this point in the history
This change do:
- Add a "Source text" tab on source anchors
- Add a "Full source text" tab on TFileAnchor displaying the full file and highlighting the source text inside
- Simplify the Fame and Source extensions of MooseObjects and SourcedEntities
  • Loading branch information
jecisc committed Oct 23, 2024
1 parent 1a21365 commit 7db7fcf
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 120 deletions.
15 changes: 15 additions & 0 deletions src/MooseIDE-NewTools/FamixTFileAnchor.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Extension { #name : #FamixTFileAnchor }

{ #category : #'*MooseIDE-NewTools' }
FamixTFileAnchor >> miFullSourceInspectorExtension [

<inspectorPresentationOrder: 5 title: 'Full sourceText'>
^ SpCodePresenter new
withoutSyntaxHighlight;
withLineNumbers;
text: self completeText;
addTextSegmentDecoration: (SpTextPresenterDecorator forHighlight
interval: (self startPos to: self endPos + 1);
yourself);
beNotEditable
]
12 changes: 12 additions & 0 deletions src/MooseIDE-NewTools/FamixTSourceAnchor.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Extension { #name : #FamixTSourceAnchor }

{ #category : #'*MooseIDE-NewTools' }
FamixTSourceAnchor >> miSourceInspectorExtension [

<inspectorPresentationOrder: 4 title: 'SourceText'>
^ SpCodePresenter new
withoutSyntaxHighlight;
withLineNumbers;
text: self sourceText;
beNotEditable
]
6 changes: 5 additions & 1 deletion src/MooseIDE-NewTools/FamixTSourceEntity.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ Extension { #name : #FamixTSourceEntity }
FamixTSourceEntity >> miSourceInspectorExtension [

<inspectorPresentationOrder: 3 title: 'SourceText'>
^ MiSourceExtension on: self
^ SpCodePresenter new
withoutSyntaxHighlight;
withLineNumbers;
text: self sourceText;
beNotEditable
]
74 changes: 0 additions & 74 deletions src/MooseIDE-NewTools/MiFameExtension.class.st

This file was deleted.

44 changes: 0 additions & 44 deletions src/MooseIDE-NewTools/MiSourceExtension.class.st

This file was deleted.

14 changes: 13 additions & 1 deletion src/MooseIDE-NewTools/MooseObject.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,19 @@ MooseObject class >> inspectorToString [
MooseObject >> miFameInspectorExtension [

<inspectorPresentationOrder: 3 title: 'Fame'>
^ MiFameExtension on: self
^ SpTablePresenter new
items: (self mooseDescription allComplexProperties sorted: #name ascending);
addColumn: (SpStringTableColumn title: 'Name' evaluated: [ :item | item name ]) yourself;
addColumn: (SpStringTableColumn title: 'Type' evaluated: [ :item | item type name ]) yourself;
addColumn: (SpStringTableColumn title: 'Opposite' evaluated: [ :item |
item opposite
ifNil: [ '' ]
ifNotNil: [ :opposite | opposite name ] ]) yourself;
addColumn: (SpStringTableColumn title: 'Derived?' evaluated: [ :item | item isDerived ]) yourself;
addColumn: (SpStringTableColumn title: 'Container?' evaluated: [ :item | item isContainer ]) yourself;
addColumn: (SpStringTableColumn title: 'IsTarget?' evaluated: [ :item | item isTarget ]) yourself;
addColumn: (SpStringTableColumn title: 'IsSource?' evaluated: [ :item | item isSource ]) yourself;
beResizable
]

{ #category : #'*MooseIDE-NewTools' }
Expand Down

0 comments on commit 7db7fcf

Please sign in to comment.