From 8c847c6911cba1d668380e517e79fa1ef6b5a748 Mon Sep 17 00:00:00 2001 From: Joana Be Date: Thu, 28 Sep 2023 13:09:06 +0200 Subject: [PATCH] Adds global dict to keep track of probes --- ...nstrumentedVersionOf.basedOn.noPattern..st | 18 +++++++++++++ .../instance/compileCue.noPattern.ifFail..st | 4 +-- .../instance/compileInstrumentedVersionOf..st | 10 ++++++- ...compileInstrumentedVersionOf.noPattern..st | 27 +++++++++++++++++++ .../BPCompiler.class/methodProperties.json | 6 +++-- ...sageSend.startTag.actualMessage.endTag..st | 2 +- .../instance/bpTemporaryProbe.with..st | 2 +- .../methodProperties.json | 2 +- .../README.md | 0 .../class/clear.st | 4 +++ .../class/default.st | 4 +++ .../instance/addProbe..st | 9 +++++++ .../instance/initialize.st | 5 ++++ .../instance/nameToProbesDict.st | 4 +++ .../instance/removeProbe..st | 6 +++++ .../methodProperties.json | 9 +++++++ .../properties.json | 14 ++++++++++ .../class/annotationTag.st | 4 +++ .../instance/asMorph.st | 9 +++++++ .../instance/className..st | 3 +++ .../instance/className.st | 3 +++ .../instance/instrumentationCallFor..st | 5 ++++ .../instance/probeTypeTag.st | 4 +++ .../instance/removeFromMethod..st | 4 +++ .../instance/variableName..st | 4 +++ .../instance/variableName.st | 4 +++ .../methodProperties.json | 10 ++++++- .../properties.json | 3 ++- .../bpTraceVariable.forProbe.inContext..st | 12 +++++++++ .../Object.extension/methodProperties.json | 1 + .../README.md | 0 .../instance/removeButtonClicked.st | 6 +++++ .../instance/step.st | 17 ++++++++++++ .../methodProperties.json | 6 +++++ .../properties.json | 14 ++++++++++ .../instance/emphasizeScanner..st | 1 + .../methodProperties.json | 2 +- ...termineIntervalOfVariableNameIn.having..st | 6 +++-- .../determineIntervalToAnnotateFor.in..st | 7 +++-- .../instance/doAddAnnotation.in..st | 16 ++++------- .../doAddAnnotationMorphToMethod.in..st | 14 ++++++++++ .../doAddInstanceProbeToRegistry.nameIn..st | 8 ++++++ .../instance/saveMethodWithExamples.st | 2 +- .../methodProperties.json | 10 ++++--- 44 files changed, 268 insertions(+), 33 deletions(-) create mode 100644 packages/Babylonian-Compiler.package/BPCompiler.class/instance/backgroundCompileInstrumentedVersionOf.basedOn.noPattern..st create mode 100644 packages/Babylonian-Compiler.package/BPCompiler.class/instance/compileInstrumentedVersionOf.noPattern..st create mode 100644 packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/README.md create mode 100644 packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/class/clear.st create mode 100644 packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/class/default.st create mode 100644 packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/addProbe..st create mode 100644 packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/initialize.st create mode 100644 packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/nameToProbesDict.st create mode 100644 packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/removeProbe..st create mode 100644 packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/methodProperties.json create mode 100644 packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/properties.json create mode 100644 packages/Babylonian-Core.package/BPInstanceVariableProbe.class/class/annotationTag.st create mode 100644 packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/asMorph.st create mode 100644 packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/className..st create mode 100644 packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/className.st create mode 100644 packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/instrumentationCallFor..st create mode 100644 packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/probeTypeTag.st create mode 100644 packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/removeFromMethod..st create mode 100644 packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/variableName..st create mode 100644 packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/variableName.st create mode 100644 packages/Babylonian-Core.package/Object.extension/instance/bpTraceVariable.forProbe.inContext..st create mode 100644 packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/README.md create mode 100644 packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/instance/removeButtonClicked.st create mode 100644 packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/instance/step.st create mode 100644 packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/methodProperties.json create mode 100644 packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/properties.json create mode 100644 packages/Babylonian-UI.package/CodeHolder.extension/instance/doAddAnnotationMorphToMethod.in..st create mode 100644 packages/Babylonian-UI.package/CodeHolder.extension/instance/doAddInstanceProbeToRegistry.nameIn..st diff --git a/packages/Babylonian-Compiler.package/BPCompiler.class/instance/backgroundCompileInstrumentedVersionOf.basedOn.noPattern..st b/packages/Babylonian-Compiler.package/BPCompiler.class/instance/backgroundCompileInstrumentedVersionOf.basedOn.noPattern..st new file mode 100644 index 00000000..f043b700 --- /dev/null +++ b/packages/Babylonian-Compiler.package/BPCompiler.class/instance/backgroundCompileInstrumentedVersionOf.basedOn.noPattern..st @@ -0,0 +1,18 @@ +private +backgroundCompileInstrumentedVersionOf: aCue basedOn: parseResult noPattern: aBoolean + + | instrumentedResult newCode | + self halt. + newCode := self rewriteToSource: parseResult. + SystemChangeNotifier uniqueInstance doSilently: [ + "Wann ist aCue getClass compile nicht mit BPCompiler?" + instrumentedResult := + aCue getClass newCompiler compileCue: (CompilationCue + source: newCode + class: aCue getClass + environment: aCue environment + requestor: nil) + noPattern: aBoolean + ifFail: [^nil] ]. + "instrumentedResult := aCue getClass compile: newCode]." + \ No newline at end of file diff --git a/packages/Babylonian-Compiler.package/BPCompiler.class/instance/compileCue.noPattern.ifFail..st b/packages/Babylonian-Compiler.package/BPCompiler.class/instance/compileCue.noPattern.ifFail..st index b0dd38f6..27c551bd 100644 --- a/packages/Babylonian-Compiler.package/BPCompiler.class/instance/compileCue.noPattern.ifFail..st +++ b/packages/Babylonian-Compiler.package/BPCompiler.class/instance/compileCue.noPattern.ifFail..st @@ -17,11 +17,11 @@ compileCue: aCueWithStyledSource noPattern: aBoolean ifFail: failBlock source: bpUnstyledSource readStream context: aCueWithStyledSource context receiver: aCueWithStyledSource receiver - class: aCueWithStyledSource getClass + class: aCueWithStyledSource getClass environment: aCueWithStyledSource environment requestor: aCueWithStyledSource requestor. originalMethodNode := super compileCue: unstyledCue noPattern: aBoolean ifFail: failBlock. - + bpUnstyledSource := originalMethodNode sourceText asString. (self methodSourceRequiresBPLayers: bpUnstyledSource) ifTrue: [ (self compileInstrumentedVersionOf: aCueWithStyledSource) ifFalse: failBlock]. diff --git a/packages/Babylonian-Compiler.package/BPCompiler.class/instance/compileInstrumentedVersionOf..st b/packages/Babylonian-Compiler.package/BPCompiler.class/instance/compileInstrumentedVersionOf..st index 0cf5268d..5a762a6c 100644 --- a/packages/Babylonian-Compiler.package/BPCompiler.class/instance/compileInstrumentedVersionOf..st +++ b/packages/Babylonian-Compiler.package/BPCompiler.class/instance/compileInstrumentedVersionOf..st @@ -11,7 +11,15 @@ compileInstrumentedVersionOf: aCue ifTrue: [ self backgroundCompileInstrumentedVersionOf: aCue basedOn: parseResult. ^ true] - ifFalse: [^ false]. + ifFalse: [ + "das oben schlägt fehl, weil er keine methoddeclaration findet" + "hier ist die cue kaputt, weil er keine class zuweisen kann. doch nochmal + ne andere compile version, die speziell für editclass zurechtgeschnitten ist?" + parseResult := PEGParserBPSmalltalk new + match: originalCode + startingFrom: #KeywordMessageSend. + parseResult succeeded ifTrue: [self backgroundCompileInstrumentedVersionOf: aCue basedOn: parseResult. + ^ true] ifFalse: [^false]]. diff --git a/packages/Babylonian-Compiler.package/BPCompiler.class/instance/compileInstrumentedVersionOf.noPattern..st b/packages/Babylonian-Compiler.package/BPCompiler.class/instance/compileInstrumentedVersionOf.noPattern..st new file mode 100644 index 00000000..36d4d590 --- /dev/null +++ b/packages/Babylonian-Compiler.package/BPCompiler.class/instance/compileInstrumentedVersionOf.noPattern..st @@ -0,0 +1,27 @@ +private +compileInstrumentedVersionOf: aCue noPattern: aBoolean + + | originalCode parseResult startingFrom | + "We do not serialize the examples into the instrumented method as + they only 'live' in the base method." + originalCode := aCue sourceStream contents asBPSourceWithoutExamples. + startingFrom := aBoolean + ifFalse: [#MethodDeclaration] + ifTrue: [#KeywordMessageSend]. + + parseResult := PEGParserBPSmalltalk new + match: originalCode + startingFrom: startingFrom. + + parseResult succeeded + ifTrue: [ + self + backgroundCompileInstrumentedVersionOf: aCue + basedOn: parseResult + noPattern: aBoolean. + ^ true] + ifFalse: [^false]. + + + + \ No newline at end of file diff --git a/packages/Babylonian-Compiler.package/BPCompiler.class/methodProperties.json b/packages/Babylonian-Compiler.package/BPCompiler.class/methodProperties.json index a588f74f..c8f79d3c 100644 --- a/packages/Babylonian-Compiler.package/BPCompiler.class/methodProperties.json +++ b/packages/Babylonian-Compiler.package/BPCompiler.class/methodProperties.json @@ -6,8 +6,10 @@ "instance" : { "annotationKeywords" : "pre 11/8/2019 20:29", "backgroundCompileInstrumentedVersionOf:basedOn:" : "pre 10/12/2020 15:36", - "compileCue:noPattern:ifFail:" : "pre 7/20/2022 16:41", - "compileInstrumentedVersionOf:" : "jb 9/9/2021 17:31", + "backgroundCompileInstrumentedVersionOf:basedOn:noPattern:" : "joabe 9/26/2023 16:07", + "compileCue:noPattern:ifFail:" : "joabe 9/27/2023 16:14", + "compileInstrumentedVersionOf:" : "joabe 9/22/2023 23:28", + "compileInstrumentedVersionOf:noPattern:" : "joabe 9/26/2023 15:54", "keywords" : "pre 11/30/2022 09:33", "methodSourceRequiresBPLayers:" : "pre 11/11/2019 15:49", "parse:" : "pre 5/3/2021 15:01", diff --git a/packages/Babylonian-Compiler.package/BPSourceRewriter.class/instance/AnnotatedKeywordMessageSend.startTag.actualMessage.endTag..st b/packages/Babylonian-Compiler.package/BPSourceRewriter.class/instance/AnnotatedKeywordMessageSend.startTag.actualMessage.endTag..st index 86102354..b5a7a993 100644 --- a/packages/Babylonian-Compiler.package/BPSourceRewriter.class/instance/AnnotatedKeywordMessageSend.startTag.actualMessage.endTag..st +++ b/packages/Babylonian-Compiler.package/BPSourceRewriter.class/instance/AnnotatedKeywordMessageSend.startTag.actualMessage.endTag..st @@ -1,4 +1,4 @@ grammar rules AnnotatedKeywordMessageSend: aNode startTag: startTag actualMessage: message endTag: endTag - ^ self rewriteNode: message withTag: startTag \ No newline at end of file + ^ self rewriteNode: message withTag: startTag \ No newline at end of file diff --git a/packages/Babylonian-Compiler.package/BPSourceRewriter.class/instance/bpTemporaryProbe.with..st b/packages/Babylonian-Compiler.package/BPSourceRewriter.class/instance/bpTemporaryProbe.with..st index cd34d7b5..55fba210 100644 --- a/packages/Babylonian-Compiler.package/BPSourceRewriter.class/instance/bpTemporaryProbe.with..st +++ b/packages/Babylonian-Compiler.package/BPSourceRewriter.class/instance/bpTemporaryProbe.with..st @@ -1,4 +1,4 @@ -as yet unclassified +rewrite rules bpTemporaryProbe: annotation with: originalExpressionSourceNode ^ annotation instrumentationCallFor: (self value: originalExpressionSourceNode) \ No newline at end of file diff --git a/packages/Babylonian-Compiler.package/BPSourceRewriter.class/methodProperties.json b/packages/Babylonian-Compiler.package/BPSourceRewriter.class/methodProperties.json index 0170b617..76ed7905 100644 --- a/packages/Babylonian-Compiler.package/BPSourceRewriter.class/methodProperties.json +++ b/packages/Babylonian-Compiler.package/BPSourceRewriter.class/methodProperties.json @@ -6,7 +6,7 @@ "AnnotatedBinaryMessageSend:startTag:actualMessage:endTag:" : "pre 3/5/2020 16:30", "AnnotatedBlockLiteral:startTag:actualBlock:endTag:" : "pre 9/1/2022 20:34", "AnnotatedExpression:startTag:actualExpression:endTag:" : "pre 1/24/2020 17:26", - "AnnotatedKeywordMessageSend:startTag:actualMessage:endTag:" : "pre 3/5/2020 16:30", + "AnnotatedKeywordMessageSend:startTag:actualMessage:endTag:" : "joabe 9/25/2023 19:01", "AnnotatedMessageChain:startTag:actualMessage:endTag:" : "pre 4/29/2020 17:01", "AnnotatedOperand:startTag:actualOperand:endTag:" : "pre 3/5/2020 17:37", "AnnotatedStatement:startTag:actualStatement:endTag:" : "jb 12/3/2020 22:36", diff --git a/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/README.md b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/README.md new file mode 100644 index 00000000..e69de29b diff --git a/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/class/clear.st b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/class/clear.st new file mode 100644 index 00000000..69bd3313 --- /dev/null +++ b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/class/clear.st @@ -0,0 +1,4 @@ +class initialization +clear + + DefaultValue := nil \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/class/default.st b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/class/default.st new file mode 100644 index 00000000..d950aeb4 --- /dev/null +++ b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/class/default.st @@ -0,0 +1,4 @@ +accessing +default + + ^ DefaultValue ifNil: [DefaultValue := self new] \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/addProbe..st b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/addProbe..st new file mode 100644 index 00000000..e04b5877 --- /dev/null +++ b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/addProbe..st @@ -0,0 +1,9 @@ +as yet unclassified +addProbe: aProbe + + nameToProbesDict at: aProbe className + ifPresent: [:registeredProbes | registeredProbes add: aProbe] + ifAbsent: [ | k | + k := KeyedSet keyBlock: [ :each | each variableName ]. + nameToProbesDict at: aProbe className put: k] + \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/initialize.st b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/initialize.st new file mode 100644 index 00000000..d5cc716d --- /dev/null +++ b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/initialize.st @@ -0,0 +1,5 @@ +initialize-release +initialize + + super initialize. + nameToProbesDict := Dictionary new. \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/nameToProbesDict.st b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/nameToProbesDict.st new file mode 100644 index 00000000..3b42976d --- /dev/null +++ b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/nameToProbesDict.st @@ -0,0 +1,4 @@ +accessing +nameToProbesDict + + ^ nameToProbesDict \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/removeProbe..st b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/removeProbe..st new file mode 100644 index 00000000..e0484392 --- /dev/null +++ b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/removeProbe..st @@ -0,0 +1,6 @@ +as yet unclassified +removeProbe: aProbe + + nameToProbesDict at: aProbe className + ifPresent: [:registeredProbes | registeredProbes remove: aProbe] + \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/methodProperties.json b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/methodProperties.json new file mode 100644 index 00000000..90daebc9 --- /dev/null +++ b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/methodProperties.json @@ -0,0 +1,9 @@ +{ + "class" : { + "clear" : "joabe 9/28/2023 12:59", + "default" : "joabe 9/28/2023 12:57" }, + "instance" : { + "addProbe:" : "joabe 9/28/2023 13:05", + "initialize" : "joabe 9/27/2023 16:33", + "nameToProbesDict" : "joabe 9/28/2023 12:59", + "removeProbe:" : "joabe 9/27/2023 17:19" } } diff --git a/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/properties.json b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/properties.json new file mode 100644 index 00000000..546f51eb --- /dev/null +++ b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "Babylonian-Core-Tracing", + "classinstvars" : [ + ], + "classvars" : [ + "DefaultValue" ], + "commentStamp" : "", + "instvars" : [ + "nameToProbesDict" ], + "name" : "BPClassNameToInstanceProbes", + "pools" : [ + ], + "super" : "DynamicVariable", + "type" : "normal" } diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/class/annotationTag.st b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/class/annotationTag.st new file mode 100644 index 00000000..0ef10469 --- /dev/null +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/class/annotationTag.st @@ -0,0 +1,4 @@ +constants +annotationTag + + ^ 'bpInstanceProbe' \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/asMorph.st b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/asMorph.st new file mode 100644 index 00000000..937e2b7d --- /dev/null +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/asMorph.st @@ -0,0 +1,9 @@ +morphic +asMorph + + | newMorph | + newMorph := BPInstanceVariableProbeMorph new + annotation: self; + yourself. + self updateTextAnchorPropertiesOf: newMorph. + ^ newMorph \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/className..st b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/className..st new file mode 100644 index 00000000..19023ac0 --- /dev/null +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/className..st @@ -0,0 +1,3 @@ +accessing +className: aString + className := aString \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/className.st b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/className.st new file mode 100644 index 00000000..08d21063 --- /dev/null +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/className.st @@ -0,0 +1,3 @@ +accessing +className + ^ className \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/instrumentationCallFor..st b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/instrumentationCallFor..st new file mode 100644 index 00000000..a4a182fd --- /dev/null +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/instrumentationCallFor..st @@ -0,0 +1,5 @@ +as yet unclassified +instrumentationCallFor: actualEnclosedExpressionSource + + ^ '(self bpTraceVariable: [{1}] forProbe: {2} inContext: thisContext)' + format: {actualEnclosedExpressionSource . self id} \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/probeTypeTag.st b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/probeTypeTag.st new file mode 100644 index 00000000..148987e6 --- /dev/null +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/probeTypeTag.st @@ -0,0 +1,4 @@ +as yet unclassified +probeTypeTag + + ^ 'bpInstanceProbe' \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/removeFromMethod..st b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/removeFromMethod..st new file mode 100644 index 00000000..40ad5f67 --- /dev/null +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/removeFromMethod..st @@ -0,0 +1,4 @@ +as yet unclassified +removeFromMethod: aCompiledMethod + + "do nothing" \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/variableName..st b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/variableName..st new file mode 100644 index 00000000..bcffb8c4 --- /dev/null +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/variableName..st @@ -0,0 +1,4 @@ +accessing +variableName: aString + + variableName := aString \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/variableName.st b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/variableName.st new file mode 100644 index 00000000..cd8d2993 --- /dev/null +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/variableName.st @@ -0,0 +1,4 @@ +accessing +variableName + + ^ variableName \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/methodProperties.json b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/methodProperties.json index 77640a59..c6954265 100644 --- a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/methodProperties.json +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/methodProperties.json @@ -1,7 +1,15 @@ { "class" : { - }, + "annotationTag" : "joabe 9/25/2023 17:30" }, "instance" : { + "asMorph" : "joabe 9/21/2023 22:32", "canBeAnnotatedTo" : "joabe 9/21/2023 21:08", + "className" : "joabe 9/27/2023 17:16", + "className:" : "joabe 9/27/2023 17:16", + "instrumentationCallFor:" : "joabe 9/25/2023 18:43", "isInstanceVariableProbe" : "joabe 9/21/2023 21:18", + "probeTypeTag" : "joabe 9/25/2023 17:30", + "removeFromMethod:" : "joabe 9/27/2023 16:43", + "variableName" : "joabe 9/27/2023 16:52", + "variableName:" : "joabe 9/27/2023 16:52", "wantsMetaClassIndication" : "joabe 9/21/2023 21:08" } } diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/properties.json b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/properties.json index 35ee499a..3d82397c 100644 --- a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/properties.json +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/properties.json @@ -6,7 +6,8 @@ ], "commentStamp" : "", "instvars" : [ - ], + "variableName", + "className" ], "name" : "BPInstanceVariableProbe", "pools" : [ ], diff --git a/packages/Babylonian-Core.package/Object.extension/instance/bpTraceVariable.forProbe.inContext..st b/packages/Babylonian-Core.package/Object.extension/instance/bpTraceVariable.forProbe.inContext..st new file mode 100644 index 00000000..5b2eb2c1 --- /dev/null +++ b/packages/Babylonian-Core.package/Object.extension/instance/bpTraceVariable.forProbe.inContext..st @@ -0,0 +1,12 @@ +*Babylonian-Core +bpTraceVariable: aVariableName forProbe: probeId inContext: aContext + + + self halt. + ^ aVariableName value, ' ' + "^ #bpInstrumented withoutLayerDo: [ + BPActiveTracer value + trace: anObject + through: [:r | r] + forProbe: probeId + inContext: aContext]" \ No newline at end of file diff --git a/packages/Babylonian-Core.package/Object.extension/methodProperties.json b/packages/Babylonian-Core.package/Object.extension/methodProperties.json index 2940c610..a6d135d8 100644 --- a/packages/Babylonian-Core.package/Object.extension/methodProperties.json +++ b/packages/Babylonian-Core.package/Object.extension/methodProperties.json @@ -13,4 +13,5 @@ "bpTrace:through:forProbe:inContext:" : "jb 11/29/2020 22:12", "bpTraceAssignmentOf:before:forProbe:inContext:" : "pre 7/6/2020 18:34", "bpTraceExecutionResult:" : "jb 12/30/2021 21:20", + "bpTraceVariable:forProbe:inContext:" : "joabe 9/27/2023 13:36", "isLiveSpecimenReference" : "pre 1/10/2023 16:16" } } diff --git a/packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/README.md b/packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/README.md new file mode 100644 index 00000000..e69de29b diff --git a/packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/instance/removeButtonClicked.st b/packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/instance/removeButtonClicked.st new file mode 100644 index 00000000..5e9e7b6f --- /dev/null +++ b/packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/instance/removeButtonClicked.st @@ -0,0 +1,6 @@ +as yet unclassified +removeButtonClicked + + super removeButtonClicked. + BPClassNameToInstanceProbes value removeProbe: self. + \ No newline at end of file diff --git a/packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/instance/step.st b/packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/instance/step.st new file mode 100644 index 00000000..c43d077e --- /dev/null +++ b/packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/instance/step.st @@ -0,0 +1,17 @@ +as yet unclassified +step + + | newTraces tracesChanged | + self resetHeight. + + "newTraces := self getTraces asIdentitySet. + tracesChanged := newTraces ~= displayedTraces. + + (allTracesCompleted not or: [tracesChanged]) ifTrue: [ + allTracesCompleted := newTraces + ifEmpty: [true] + ifNotEmpty: [:ts | ts allSatisfy: [:t | t hasTraceCompleted]]. + self updateFrom: (newTraces ifEmpty: [self emptyTraces]). + displayedTraces := newTraces]." + + "tracesChanged ifTrue: [self refreshTextComposition]." \ No newline at end of file diff --git a/packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/methodProperties.json b/packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/methodProperties.json new file mode 100644 index 00000000..0179c284 --- /dev/null +++ b/packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/methodProperties.json @@ -0,0 +1,6 @@ +{ + "class" : { + }, + "instance" : { + "removeButtonClicked" : "joabe 9/27/2023 17:19", + "step" : "joabe 9/25/2023 18:34" } } diff --git a/packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/properties.json b/packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/properties.json new file mode 100644 index 00000000..6dc83484 --- /dev/null +++ b/packages/Babylonian-UI.package/BPInstanceVariableProbeMorph.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "Babylonian-UI-Morphs", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], + "name" : "BPInstanceVariableProbeMorph", + "pools" : [ + ], + "super" : "BPProbeMorph", + "type" : "normal" } diff --git a/packages/Babylonian-UI.package/BPTextDecoration.class/instance/emphasizeScanner..st b/packages/Babylonian-UI.package/BPTextDecoration.class/instance/emphasizeScanner..st index 424817cf..9afaa8f6 100644 --- a/packages/Babylonian-UI.package/BPTextDecoration.class/instance/emphasizeScanner..st +++ b/packages/Babylonian-UI.package/BPTextDecoration.class/instance/emphasizeScanner..st @@ -2,6 +2,7 @@ accessing emphasizeScanner: scanner "Set the emphasis for text scanning" | emphasis | + emphasis := self anchoredMorph textEmphasis ifNil: [ self anchoredMorph visible ifTrue: [TextEmphasis underlined] diff --git a/packages/Babylonian-UI.package/BPTextDecoration.class/methodProperties.json b/packages/Babylonian-UI.package/BPTextDecoration.class/methodProperties.json index bc5dade6..c75102ed 100644 --- a/packages/Babylonian-UI.package/BPTextDecoration.class/methodProperties.json +++ b/packages/Babylonian-UI.package/BPTextDecoration.class/methodProperties.json @@ -3,7 +3,7 @@ "compilerClass" : "pre 11/8/2019 20:33" }, "instance" : { "emphasisCode" : "pre 11/8/2019 13:33", - "emphasizeScanner:" : "pre 9/2/2022 15:35", + "emphasizeScanner:" : "joabe 9/21/2023 22:56", "initialize" : "pre 7/19/2022 17:54", "isBPDecoration" : "pre 8/17/2023 08:37", "isOblivious" : "pre 7/9/2021 16:59", diff --git a/packages/Babylonian-UI.package/CodeHolder.extension/instance/determineIntervalOfVariableNameIn.having..st b/packages/Babylonian-UI.package/CodeHolder.extension/instance/determineIntervalOfVariableNameIn.having..st index d3c19ef8..6dc34a4f 100644 --- a/packages/Babylonian-UI.package/CodeHolder.extension/instance/determineIntervalOfVariableNameIn.having..st +++ b/packages/Babylonian-UI.package/CodeHolder.extension/instance/determineIntervalOfVariableNameIn.having..st @@ -2,7 +2,7 @@ determineIntervalOfVariableNameIn: anInterval having: aTopologicalCollectionOfAncestors | lowestKeywordMessageSegment selectedText | - + lowestKeywordMessageSegment := aTopologicalCollectionOfAncestors detect: [:n | n ruleName = #KeywordMessageSegment] ifNone: [^ nil]. @@ -10,11 +10,13 @@ determineIntervalOfVariableNameIn: anInterval having: aTopologicalCollectionOfAn ((self contents atAll: lowestKeywordMessageSegment children first interval) ~= 'instanceVariableNames:') ifTrue: [^ nil]. selectedText := (self contents atAll: anInterval) withBlanksTrimmed. + self flag: #todo. "wenn es sowas wie aha und aha2 gibt, dann wird das falsch sein, wenn ich aha markiere + und aha2 als erstes kommt" ^ self selectedClassOrMetaClass instVarNames detect: [:aVariable | aVariable = selectedText] ifFound: [:matchingVariable | | start | start := self contents findString: matchingVariable. - ^ Interval from: start to: start + matchingVariable size] + ^ Interval from: start to: start + matchingVariable size - 1] \ No newline at end of file diff --git a/packages/Babylonian-UI.package/CodeHolder.extension/instance/determineIntervalToAnnotateFor.in..st b/packages/Babylonian-UI.package/CodeHolder.extension/instance/determineIntervalToAnnotateFor.in..st index d539f4ec..574784ed 100644 --- a/packages/Babylonian-UI.package/CodeHolder.extension/instance/determineIntervalToAnnotateFor.in..st +++ b/packages/Babylonian-UI.package/CodeHolder.extension/instance/determineIntervalToAnnotateFor.in..st @@ -7,18 +7,17 @@ determineIntervalToAnnotateFor: anAnnotation in: anInterval If there is not valid interval this method will return nil." self bpEnsureContentsAndSelectedMessage. - self halt. sourceMap := currentCompiledMethod ifNotNil: [currentCompiledMethod bpSourceMap] ifNil: [self bpClassDeclarationSourceMap]. result := self - allAndLowestUsefulAncestorFor: (sourceMap atAll: anInterval) + allAndLowestUsefulAncestorFor: (sourceMap atAll: {anInterval start. anInterval stop}) canBeAnnotatedTo: anAnnotation canBeAnnotatedTo. result second ifNil: [^ nil]. anAnnotation isInstanceVariableProbe ifFalse: [^ result second interval]. - + (self editSelection == #editClass and: [self metaClassIndicated == anAnnotation wantsMetaClassIndication]) ifFalse: [^ nil]. ^ self determineIntervalOfVariableNameIn: anInterval - having: result first. + having: result first. \ No newline at end of file diff --git a/packages/Babylonian-UI.package/CodeHolder.extension/instance/doAddAnnotation.in..st b/packages/Babylonian-UI.package/CodeHolder.extension/instance/doAddAnnotation.in..st index 9aa8179c..a19159cf 100644 --- a/packages/Babylonian-UI.package/CodeHolder.extension/instance/doAddAnnotation.in..st +++ b/packages/Babylonian-UI.package/CodeHolder.extension/instance/doAddAnnotation.in..st @@ -1,16 +1,10 @@ *Babylonian-UI-private doAddAnnotation: anAnnotation in: interval "Separated from addAnotationIn: to allow for multiple annotations to be added without saving first." - | text actualInterval newMorph | + | actualInterval | actualInterval := self determineIntervalToAnnotateFor: anAnnotation in: interval. actualInterval ifNil: [self codeTextMorph textMorph flash. ^ self]. - anAnnotation methodReference: self methodReference. - text := self codeTextMorph text. - newMorph := anAnnotation asMorph. - text - addAttribute: (BPTextDecoration new - anchoredMorph: newMorph; - yourself) - from: actualInterval start - to: actualInterval stop. - (self codeTextMorph) addMorph: newMorph. \ No newline at end of file + + anAnnotation isInstanceVariableProbe + ifTrue: [self doAddInstanceProbeToRegistry: anAnnotation nameIn: actualInterval] + ifFalse: [self doAddAnnotationMorphToMethod: anAnnotation in: actualInterval]. \ No newline at end of file diff --git a/packages/Babylonian-UI.package/CodeHolder.extension/instance/doAddAnnotationMorphToMethod.in..st b/packages/Babylonian-UI.package/CodeHolder.extension/instance/doAddAnnotationMorphToMethod.in..st new file mode 100644 index 00000000..1f318cb1 --- /dev/null +++ b/packages/Babylonian-UI.package/CodeHolder.extension/instance/doAddAnnotationMorphToMethod.in..st @@ -0,0 +1,14 @@ +*Babylonian-UI-private +doAddAnnotationMorphToMethod: anAnnotation in: anInterval + + | text newMorph | + anAnnotation methodReference: self methodReference. + text := self codeTextMorph text. + newMorph := anAnnotation asMorph. + text + addAttribute: (BPTextDecoration new + anchoredMorph: newMorph; + yourself) + from: anInterval start + to: anInterval stop. + (self codeTextMorph) addMorph: newMorph \ No newline at end of file diff --git a/packages/Babylonian-UI.package/CodeHolder.extension/instance/doAddInstanceProbeToRegistry.nameIn..st b/packages/Babylonian-UI.package/CodeHolder.extension/instance/doAddInstanceProbeToRegistry.nameIn..st new file mode 100644 index 00000000..7b1e5217 --- /dev/null +++ b/packages/Babylonian-UI.package/CodeHolder.extension/instance/doAddInstanceProbeToRegistry.nameIn..st @@ -0,0 +1,8 @@ +*Babylonian-UI-private +doAddInstanceProbeToRegistry: anInstanceVariableProbe nameIn: anInterval + + anInstanceVariableProbe + variableName: (self codeTextMorph text atAll: {anInterval start. anInterval stop}); + className: (self selectedClass name). + BPClassNameToInstanceProbes value addProbe: anInstanceVariableProbe + \ No newline at end of file diff --git a/packages/Babylonian-UI.package/CodeHolder.extension/instance/saveMethodWithExamples.st b/packages/Babylonian-UI.package/CodeHolder.extension/instance/saveMethodWithExamples.st index ae4de306..f831c874 100644 --- a/packages/Babylonian-UI.package/CodeHolder.extension/instance/saveMethodWithExamples.st +++ b/packages/Babylonian-UI.package/CodeHolder.extension/instance/saveMethodWithExamples.st @@ -1,6 +1,6 @@ *Babylonian-UI-private saveMethodWithExamples - + self codeTextMorph hasUnacceptedEdits: true; accept. \ No newline at end of file diff --git a/packages/Babylonian-UI.package/CodeHolder.extension/methodProperties.json b/packages/Babylonian-UI.package/CodeHolder.extension/methodProperties.json index ca85a0a2..3adbe0ca 100644 --- a/packages/Babylonian-UI.package/CodeHolder.extension/methodProperties.json +++ b/packages/Babylonian-UI.package/CodeHolder.extension/methodProperties.json @@ -20,11 +20,13 @@ "codePaneMenuBPTracingItems:" : "pre 9/2/2022 15:06", "compiledMethod" : "ct 3/30/2022 16:48", "determineIntervalOfReceiver:" : "pre 9/2/2022 14:29", - "determineIntervalOfVariableNameIn:having:" : "joabe 9/21/2023 21:40", - "determineIntervalToAnnotateFor:in:" : "joabe 9/21/2023 21:29", + "determineIntervalOfVariableNameIn:having:" : "joabe 9/26/2023 11:33", + "determineIntervalToAnnotateFor:in:" : "joabe 9/26/2023 13:52", "determineMessageSendNodeIn:" : "joabe 9/21/2023 21:31", "determineSelectorOfMessageSend:" : "pre 9/2/2022 14:49", - "doAddAnnotation:in:" : "joabe 9/21/2023 21:28", + "doAddAnnotation:in:" : "joabe 9/27/2023 17:22", + "doAddAnnotationMorphToMethod:in:" : "joabe 9/27/2023 16:21", + "doAddInstanceProbeToRegistry:nameIn:" : "joabe 9/28/2023 13:06", "doBrowseActualImplementersFromProbe:andSelector:" : "pre 9/2/2022 15:54", "doItReceiver" : "ct 3/30/2022 16:48", "exampleForEvaluation" : "ct 8/18/2021 23:15", @@ -38,5 +40,5 @@ "removeReplacementFromSelection" : "pre 4/29/2020 19:07", "removeSelectedAnnotationsSatisfying:" : "pre 9/2/2022 14:42", "removeTypeProbeFromSelection" : "pre 11/30/2022 09:40", - "saveMethodWithExamples" : "jb 3/5/2022 15:02", + "saveMethodWithExamples" : "joabe 9/22/2023 22:57", "saveMethodWithExamplesWith:" : "pre 8/6/2019 13:57" } }