Skip to content

Commit

Permalink
show slice in the module/category/definition lists
Browse files Browse the repository at this point in the history
  • Loading branch information
tomooda committed Jul 5, 2024
1 parent 9a0d5dc commit f78431d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1438,6 +1438,12 @@ ViennaRefactoringBrowser >> initializePresenters [
moduleList := self newList
beSingleSelection;
contextMenu: [ self moduleListContextMenu ];
displayBackgroundColor: [ :ast |
(ast notNil and: [
ast hasAnyDescendantsSuchThat: [ :node |
sliceNodes includes: node ] ])
ifTrue: [ self sliceColor ]
ifFalse: [ Color transparent ] ];
display: [ :ast | ast ifNil: [ '-' ] ifNotNil: #first ];
whenSelectionChangedDo: [
self
Expand All @@ -1447,11 +1453,23 @@ ViennaRefactoringBrowser >> initializePresenters [
categoryList := self newList
beSingleSelection;
contextMenu: [ self categoryListContextMenu ];
displayBackgroundColor: [ :ast |
(ast notNil and: [
ast hasAnyDescendantsSuchThat: [ :node |
sliceNodes includes: node ] ])
ifTrue: [ self sliceColor ]
ifFalse: [ Color transparent ] ];
display: [ :ast | self displayCategory: ast ];
whenSelectionChangedDo: [ self updateDefinitionList ];
yourself.
definitionList := self newList
beSingleSelection;
displayBackgroundColor: [ :ast |
(ast notNil and: [
ast hasAnyDescendantsSuchThat: [ :node |
sliceNodes includes: node ] ])
ifTrue: [ self sliceColor ]
ifFalse: [ Color transparent ] ];
contextMenu: [ self definitionListContextMenu ];
display: [ :ast |
ast
Expand Down Expand Up @@ -2116,13 +2134,21 @@ ViennaRefactoringBrowser >> setDirty [
ViennaRefactoringBrowser >> sliceAttribute [

^ sliceAttribute ifNil: [
sliceAttribute := TextBackgroundColor color:
(Color cyan mixed: 0.2 with: Color white) ]
sliceAttribute := TextBackgroundColor color: self sliceColor ]
]

{ #category : 'operations-slicing' }
ViennaRefactoringBrowser >> sliceColor [

^ Color cyan alpha: 0.2
]

{ #category : 'updating' }
ViennaRefactoringBrowser >> sliceNodesChanged [

moduleList refresh.
categoryList refresh.
definitionList refresh.
self updateSource
]

Expand Down
13 changes: 7 additions & 6 deletions repository/ViennaTalk-Slicing-Core/ViennaSlicer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,13 @@ ViennaSlicer >> cut [
self initializeAgenda.
toplevelDefinition isViennaStateDefinitionNode
ifTrue: [
toplevelDefinition module toplevelDefinitionsDo: [ :toplevel |
toplevel isViennaExplicitOperationDefinitionNode ifTrue: [
self continue: (self interOperationSlicer
slicerOnOperation: toplevel
criteria: self criteria
callerSlicer: self) ] ] ]
toplevelDefinition document modulesDo: [ :module |
module toplevelDefinitionsDo: [ :toplevel |
toplevel isViennaExplicitOperationDefinitionNode ifTrue: [
self continue: (self interOperationSlicer
slicerOnOperation: toplevel
criteria: self criteria
callerSlicer: self) ] ] ] ]
ifFalse: [ toplevelDefinition sliceWith: self ].
^ affectingNodes
]
Expand Down

0 comments on commit f78431d

Please sign in to comment.