Skip to content

Commit

Permalink
delegate interval computation to `TGtSourceCoderEvaluatedCode>>#findS…
Browse files Browse the repository at this point in the history
…ourceIntervalForContext:sourceString:` [feenkcom/gtoolkit#3735]
  • Loading branch information
JurajKubelka committed May 14, 2024
1 parent 36b01e2 commit b73fb16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,9 @@ GtCoderEmbeddedDebugSessionEvaluationStatus >> evaluatedCodeInterval [

^ self
forPharo11OrNewer: [ self debugSession pcRangeForContext: aContext ]
forPharo10: [ | aUsedAst anInterval |
aUsedAst := self evaluatedCode findSourceAstForContext: aContext.
anInterval := GtPharoMethodNodeSourceIntervalFinder new
methodNode: aUsedAst;
sourceString: self sourceString;
find.
anInterval last isZero ifTrue: [ nil ] ifFalse: [ anInterval ] ]
forPharo10: [ self evaluatedCode
findSourceIntervalForContext: aContext
sourceString: self sourceString ]
]

{ #category : #accessing }
Expand Down
6 changes: 3 additions & 3 deletions src/GToolkit-Coder/TGtSourceCoderEvaluatedCode.trait.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ TGtSourceCoderEvaluatedCode >> findRelevantContextInStack: aStack [
]

{ #category : #accessing }
TGtSourceCoderEvaluatedCode >> findSourceAstForContext: aContext [
"Return an AST node that corresponds to a given executed code."
TGtSourceCoderEvaluatedCode >> findSourceIntervalForContext: aContext sourceString: aSourceString [
"Return source code interval that corresponds to a given executed code."

<return: #RBMessageNode>
<return: #Interval or: nil>
^ nil
]

0 comments on commit b73fb16

Please sign in to comment.