Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions src/BaselineOfFAST/BaselineOfFAST.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,22 @@ BaselineOfFAST >> ensureMoose12Compatibility [
"FAST v3 works on Moose 12 and Moose 13. Since we are using some methods of Moose 13, I ensure we have everything needed. Delete me once Moose 12 support will be dropped."

| class |
'Ensuring compatibility methods' traceCr.
class := self class environment at: #TEntityMetaLevelDependency.

(class includesSelector: #containersOfType:) ifFalse: [
class
compile: 'containersOfType: aType
'Ensuring compatibility methods' traceCr.
{ 'containersOfType: aType
"I am used to return all the first encountered entities at a given famix class scope that are up in the containment tree of the metamodel"

^ self query containers ofType: aType'
classified: '*FAST-Moose12-Compatibility' ].
^ self query containers ofType: aType'.


'containedEntities

(class includesSelector: #containedEntities) ifFalse: [
class
compile: 'containedEntities
^ self children'.


'allContainedEntities

^ self children'
classified: '*FAST-Moose12-Compatibility' ]
^ self allChildren' } do: [ :method | class compile: method classified: '*FAST-Moose12-Compatibility' ] ]
]
8 changes: 3 additions & 5 deletions src/FAST-Core-Model-Extension/FASTTEntity.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,11 @@ FASTTEntity >> inspectionFAST: aBuilder [
addColumn: ((SpImageTableColumn evaluated: #mooseIcon)
width: 20;
yourself);
addColumn:
(SpStringTableColumn evaluated: [ :node | node display ]);
addColumn: (SpStringTableColumn evaluated: [ :node | node display ]);
yourself);
children: [ :aClass |
aClass children asArray sorted: [ :a :b |
(a startPos ifNil: [ 0 ]) <= (b startPos ifNil: [ 0 ]) ] ];
children: [ :aClass | aClass containedEntities asArray sorted: [ :a :b | (a startPos ifNil: [ 0 ]) <= (b startPos ifNil: [ 0 ]) ] ];
beMultipleSelection;
expandAll;
roots: { self };
beResizable;
yourself
Expand Down
8 changes: 4 additions & 4 deletions src/FAST-Core-Tools/FASTTextHighlighter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ FASTTextHighlighter >> color: anElementString with: aColor [

{ #category : 'public' }
FASTTextHighlighter >> highlight: anFASTEntity [

| text |
text := anFASTEntity sourceText asText.
anFASTEntity allChildren
do: [ :child |
(child startPos isNotNil and: child endPos isNotNil)
ifTrue: [ attributeMapper at: child class ifPresent: [ :attributes | attributes do: [ :each | text addAttribute: each from: child startPos to: child endPos ] ] ] ].
anFASTEntity allContainedEntities do: [ :child |
(child startPos isNotNil and: [ child endPos isNotNil ]) ifTrue: [
attributeMapper at: child class ifPresent: [ :attributes | attributes do: [ :each | text addAttribute: each from: child startPos to: child endPos ] ] ] ].
^ text
]

Expand Down
Loading