-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds linked probes at right intervals and deletes them properly
- Loading branch information
Showing
32 changed files
with
135 additions
and
91 deletions.
There are no files selected for viewing
18 changes: 0 additions & 18 deletions
18
...ge/BPCompiler.class/instance/backgroundCompileInstrumentedVersionOf.basedOn.noPattern..st
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
...ian-Compiler.package/BPCompiler.class/instance/compileInstrumentedVersionOf.noPattern..st
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
packages/Babylonian-Compiler.package/BPCompiler.class/instance/rewriteToSource..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
private | ||
rewriteToSource: parseResult | ||
|
||
^ self rewriter value: parseResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/Babylonian-Core.package/BPAnnotation.class/instance/removeFromMethod..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...ages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/deleteLinkedProbes.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
initialize-release | ||
deleteLinkedProbes | ||
|
||
| browser | | ||
browser := BPBrowser open. | ||
self linkedProbes do: [:aProbe | | ||
browser browseReference: aProbe methodReference. | ||
browser removeAnnotations: {aProbe}]. | ||
|
||
browser currentWindow delete. |
6 changes: 6 additions & 0 deletions
6
packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/initialize.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
initialize-release | ||
initialize | ||
|
||
super initialize. | ||
|
||
linkedProbes := OrderedCollection new. |
8 changes: 5 additions & 3 deletions
8
...Babylonian-Core.package/BPInstanceVariableProbe.class/instance/instrumentationCallFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
as yet unclassified | ||
serialization | ||
instrumentationCallFor: actualEnclosedExpressionSource | ||
|
||
^ '(self bpTraceVariable: [{1}] forProbe: {2} inContext: thisContext)' | ||
format: {actualEnclosedExpressionSource . self id} | ||
^ '(self bpTraceVariable: [{1}] forProbe: {2} linked: \{{3}\} inContext: thisContext)' | ||
format: {actualEnclosedExpressionSource . | ||
self id. | ||
((self linkedProbes gather: [:probe | probe id]) joinSeparatedBy: ' . ')} |
4 changes: 4 additions & 0 deletions
4
packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/linkedProbes.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
linkedProbes | ||
|
||
^ linkedProbes |
2 changes: 1 addition & 1 deletion
2
packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/probeTypeTag.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
as yet unclassified | ||
serialization | ||
probeTypeTag | ||
|
||
^ 'bpInstanceProbe' |
2 changes: 1 addition & 1 deletion
2
packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/removeFromMethod..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
as yet unclassified | ||
initialize-release | ||
removeFromMethod: aCompiledMethod | ||
|
||
"do nothing" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...Core.package/CompiledMethod.extension/instance/bpExtractVariableAssignmentRangesNamed..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
*Babylonian-Core | ||
bpExtractVariableAssignmentRangesNamed: aVariableName | ||
|
||
^ (self extractAssignmentIntervalsFrom: self parseTree named: aVariableName) flatten | ||
|
||
|
19 changes: 19 additions & 0 deletions
19
...n-Core.package/CompiledMethod.extension/instance/extractAssignmentIntervalsFrom.named..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
*Babylonian-Core | ||
extractAssignmentIntervalsFrom: aRBNodeWithBody named: aVariableName | ||
|
||
"Private" | ||
| currentIntervals nestedIntervals | | ||
"No shadowing" | ||
((aRBNodeWithBody body temporaries collect: [:aVariableNode | aVariableNode token value]) | ||
includes: aVariableName) ifTrue: [^ #()]. | ||
|
||
nestedIntervals := aRBNodeWithBody body statements select: [:aRBNode | aRBNode isBlock] | ||
thenCollect: [:aBlockNode | self extractAssignmentIntervalsFrom: aBlockNode named: aVariableName]. | ||
currentIntervals := aRBNodeWithBody body statements select: [:aRBNode | | ||
aRBNode isAssignment and: [aRBNode variable token value = aVariableName]] | ||
thenCollect: [:anAssignmentNode | | ||
anAssignmentNode startWithoutParentheses@anAssignmentNode stopWithoutParentheses]. | ||
|
||
^ currentIntervals, nestedIntervals | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
.../Babylonian-UI.package/BPInstanceVariableProbeMorph.class/instance/removeButtonClicked.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
as yet unclassified | ||
removeButtonClicked | ||
|
||
"LSP violation here - but otherwise the removal of the morph won't happen... -jb" | ||
self annotation deleteLinkedProbes. | ||
|
||
BPClassNameToInstanceProbes value removeProbe: self annotation. | ||
super removeButtonClicked. | ||
|
||
self containingBrowser removeAnnotations: {self annotation}. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
packages/Babylonian-UI.package/CodeHolder.extension/instance/doAddLinkedAnnotationsFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*Babylonian-UI-private | ||
doAddLinkedAnnotationsFor: anInstanceVariableProbe | ||
|
||
| allSenderMethods | | ||
allSenderMethods := (self systemNavigation | ||
allAccessesTo: anInstanceVariableProbe variableName | ||
from: (Smalltalk bindingOf: (anInstanceVariableProbe assignedClassName asSymbol)) value). | ||
|
||
allSenderMethods collect: [:aMethodReference | self doAddLinkedAnnotationsFor: anInstanceVariableProbe in: aMethodReference]. |
14 changes: 14 additions & 0 deletions
14
...ages/Babylonian-UI.package/CodeHolder.extension/instance/doAddLinkedAnnotationsFor.in..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
*Babylonian-UI-private | ||
doAddLinkedAnnotationsFor: anInstanceVariableProbe in: aMethodReference | ||
|
||
| allRanges styledText | | ||
allRanges := aMethodReference compiledMethod bpExtractVariableAssignmentRangesNamed: anInstanceVariableProbe variableName. | ||
styledText := aMethodReference sourceCode. | ||
|
||
allRanges do: [:aRange | anInstanceVariableProbe linkedProbes add: | ||
(self styleText: styledText in: aRange referencing: aMethodReference)]. | ||
|
||
allRanges ifNotEmpty: [SystemChangeNotifier uniqueInstance doSilently: | ||
[aMethodReference actualClass | ||
compile: (BPStyler new unstyledTextFrom: styledText) | ||
classified: aMethodReference category]]. |
13 changes: 13 additions & 0 deletions
13
packages/Babylonian-UI.package/CodeHolder.extension/instance/styleText.in.referencing..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
*Babylonian-UI-private | ||
styleText: aText in: aRange referencing: aMethodReference | ||
|
||
| linkedProbe | | ||
self flag: #todo. "If assignment already has an annotation, re-use that one" | ||
linkedProbe := BPProbe new methodReference: aMethodReference. | ||
aText addAttribute: ( | ||
BPTextDecoration new | ||
anchoredMorph: linkedProbe asMorph; | ||
yourself) | ||
from: aRange x | ||
to: aRange y. | ||
^ linkedProbe |
Oops, something went wrong.