Skip to content

Commit

Permalink
enable / disable syntax highlight in code presenter of critics browser.
Browse files Browse the repository at this point in the history
  • Loading branch information
demarey committed Mar 22, 2024
1 parent 2e4b194 commit a93f43c
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,10 @@ StSingleCritiqueResultListPresenter >> isCritiqueToDo [
{ #category : 'initialization' }
StSingleCritiqueResultListPresenter >> newSourceCodeCritique [

^ SpCodePresenter new beNotEditable.
^ SpCodePresenter new
beNotEditable;
withoutSyntaxHighlight;
yourself
]

{ #category : 'initialization' }
Expand Down Expand Up @@ -414,10 +417,13 @@ StSingleCritiqueResultListPresenter >> setTextModelForClassOrMethod: aCritique [
entity := aCritique sourceAnchor entity.
self flag:
'Another hack. We need a better way to display entities (because now we may get not only classes and methods. Maybe something like GTInspector presentations could work)'.
sourceCodeModel text: entity asString.
sourceCodeModel behavior: (entity isCompiledMethod
sourceCodeModel beForBehavior: (entity isCompiledMethod
ifTrue: [ entity methodClass ]
ifFalse: [ nil ]).

sourceCodeModel
withSyntaxHighlight;
text: entity asString.
aCritique sourceAnchor providesInterval ifTrue: [
sourceCodeModel selectionInterval: aCritique sourceAnchor interval ]
]
Expand All @@ -429,8 +435,10 @@ StSingleCritiqueResultListPresenter >> setTextModelForNil [
text := rule rationale isEmpty
ifTrue: [ rule name ]
ifFalse: [ rule rationale ].
sourceCodeModel text: text.
sourceCodeModel behavior: nil.
sourceCodeModel
withoutSyntaxHighlight;
text: text;
behavior: nil.
toolbarModel critique: nil
]

Expand Down

0 comments on commit a93f43c

Please sign in to comment.