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

Add Instance Probes #162

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open

Add Instance Probes #162

wants to merge 14 commits into from

Conversation

JoeAtHPI
Copy link
Collaborator

@JoeAtHPI JoeAtHPI commented Oct 7, 2023

Instance Probes are a new kind of annotation which can be added to instance variable names in class' definitions.

They will add assignment probes throughout all methods of the responding class in which the variable gets directly assigned. For example, selecting 'foo' will add probes to all lines containing 'foo := ' instead of 'foo: '. Shadowing ignored.
In the instance probe, which gets displayed in class' defintions, users will see the chronologically ordered trace of all values of the added assignment probes. When deleting one of those linked probes, its values also disappear from the instance probe trace. Deleting the instance probe will delete the linked probes.

This feature used to be achieved by manually adding probes to only assignments and displaying the example in the ProbeLog.

image

Future Todos are:

@JoeAtHPI JoeAtHPI added the enhancement New feature or request label Oct 7, 2023
@JoeAtHPI JoeAtHPI self-assigned this Oct 7, 2023
@coveralls
Copy link

coveralls commented Oct 7, 2023

Pull Request Test Coverage Report for Build 6612398046

  • 11 of 16 (68.75%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+5.0%) to 69.79%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/Babylonian-Compiler.package/BPSourceRewriter.class/instance/bpTemporaryProbe.with..st 0 1 0.0%
packages/Babylonian-ProbeLog.package/BPSwimlaneLineMorph.class/instance/fontColor.st 0 4 0.0%
Totals Coverage Status
Change from base Build 6379831868: 5.0%
Covered Lines: 1296
Relevant Lines: 1857

💛 - Coveralls

@JoeAtHPI
Copy link
Collaborator Author

JoeAtHPI commented Oct 7, 2023

@codeZeilen tests failing due to compiledmethod not knowing parseTree which uses RBParser. add it to baseline or is there another existing parser which gets the intervals like i intend to?

@codeZeilen
Copy link
Member

@codeZeilen tests failing due to compiledmethod not knowing parseTree which uses RBParser. add it to baseline or is there another existing parser which gets the intervals like i intend to?

@JoeAtHPI Ohm should be able to handle this. You may want to look at BPSourceMapping and BPSourceMapNode and the place where they are used. You should be able to create a source map with BPSourceMapping new value: .... Then you can simply take the first element of the source map and there the first node. This is the top-most node in the parse tree. Each node contains an interval which you can use to get the source section from the original string.

If you can really not get this to work you may add the dependency to RBParser (but, as we have Ohm it would be preferable to avoid this additional dependency to a parser). :)

Copy link
Member

@codeZeilen codeZeilen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First noted/questions. Will come back later for more. :)

@@ -1,27 +0,0 @@
*Babylonian-ExampleMining-Core-override
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several of these example mining methods disappeared. Is this intentional? Where did they go? :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, will add them back later!

@@ -5,7 +5,7 @@
A Smalltalk implementation of the Babylonian Programming System.

## How to install
1. Get [a recent Squeak][squeakorg]
1. Get [a recent trunk Squeak][squeakorg]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is trunk needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will revert this

@@ -15,11 +15,6 @@ Metacello new
repository: 'github://hpi-swa-lab/babylonian-programming-smalltalk:main/packages';
load.
```
4. (Recommended) Disable the preference for notifications on saving methods with styles. This prevents that you will be asked whether you want to save style information whenever you save a method with probes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, i think the readme got a bit messed up when dev was merged

private
allBabylonianInternalClasses
^ #('Babylonian-Core' 'Babylonian-Compiler' 'Babylonian-UI' 'Babylonian-ProbeLog')
inject: OrderedCollection new
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use gather for this. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants