Skip to content

Compiler: stop playing notification pingpong#13047

Merged
MarcusDenker merged 9 commits intopharo-project:Pharo12from
privat:faulty-code-kill-notification-pingpong
Mar 19, 2023
Merged

Compiler: stop playing notification pingpong#13047
MarcusDenker merged 9 commits intopharo-project:Pharo12from
privat:faulty-code-kill-notification-pingpong

Conversation

@privat
Copy link
Contributor

@privat privat commented Mar 18, 2023

Big step, but I tried to make it as small and simple as possible for testability and reviewability (especially commit by commit).

Up to now, automatic (mandatory!) code reparation on compilation error (the "undefined variable foo, please do something or cancel" menu) is managed through a complex exceptions mess and badly designed responsibility assignment.
Unfortunately, getting rid of it is less easy as it seems (and it seems hard!)

This PR does the main part of the cleanup:

  • UI related stuff still in the compiler is grouped and moved to a simple single dedicated method parseForRequestor (still bad, but much less bad)
  • OCUndeclaredVariableWarning stops opening the menu by itself as default action. All that remains is the console warning for CI.
  • parseForRequestor catches OCUndeclaredVariableWarning instead of ReparseAfterSourceEditing, open the menu, and retry the parsing all by itself (previously it was done by OCUndeclaredVariableWarning)
  • ReparseAfterSourceEditing is removed
  • I repeat, ReparseAfterSourceEditing is removed
  • Tests are added (there was none, except a very bad and limited one)

What is not done and let for future PR

  • move the menu UI and reparation logic outside OCUndeclaredVariableWarning
  • simplify exception hierarchy OCSemanticWarning
  • kill parseForRequestor for good

@Ducasse
Copy link
Member

Ducasse commented Mar 18, 2023

Great. You see this is a legacy from the "interactive" view of the world.
I do not blame them. They were inventing everything so stepping back and thinking in terms of layers and minimizing the dependency and strange logical flow in a context where you have 64kb....
Now this is our responsibility to clean and I love your effort.

@privat
Copy link
Contributor Author

privat commented Mar 18, 2023

Tests failed because of a single test in NewTools. Not nice.
The test tries to intercept some exceptions but because the ping-pong is removed, then the menu is open and the test fails.

I do not want to add a buggy workaround here in compiler (like identifying the specific requestor or test) so I should fix the test in the other repository.

@Ducasse
Copy link
Member

Ducasse commented Mar 18, 2023

Sure! We should target all green tests else it will block us for no reason.

@privat
Copy link
Contributor Author

privat commented Mar 18, 2023

Test does not seem really fixable now, so I propose to simply skip it pharo-spec/NewTools#492.
We will re-enable it (or reimplement it) once the compiler cleaning is done and its API stabilized.

@privat privat changed the base branch from Pharo12 to Pharo11 March 18, 2023 18:33
@privat privat changed the base branch from Pharo11 to Pharo12 March 18, 2023 18:33
@privat privat changed the base branch from Pharo12 to Pharo11 March 18, 2023 22:47
@privat privat changed the base branch from Pharo11 to Pharo12 March 18, 2023 22:47
@jecisc jecisc added this to the 12.0.0 milestone Mar 18, 2023
@MarcusDenker
Copy link
Member

Very nice... such a huge step to be able to remove ReparseAfterSourceEditing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants