Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable / disable syntax highlight in code presenter of critics browser. #727

Merged
merged 2 commits into from
Mar 23, 2024
Merged
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
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 @@ -412,12 +415,13 @@ StSingleCritiqueResultListPresenter >> setTextModelForClassOrMethod: aCritique [

| entity |
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 +433,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
Loading