Skip to content

Cleanup some JSDocs related to observables #228739

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pisv
Copy link
Contributor

@pisv pisv commented Sep 16, 2024

Mainly, this PR proposes to relax the constraint

Before the given observable can call this method again, is must call IObserver.endUpdate

in the JSDoc for the IObserver.beginUpdate method.

All existing observer implementations in VS Code are resilient to repeated calls of beginUpdate for the same observable, provided that each call is eventually accompanied with the corresponding endUpdate call. (All the implementations are based on using an update counter.)

Whereas the current implementation of ObservableValue does not satisfy this constraint when its set method is repeatedly called with the same transaction. (In that case, it will repeatedly call tx.updateObserver(observer, this), which will repeatedly call observer.beginUpdate(observable).)

@mjbvz mjbvz assigned hediet and unassigned mjbvz Sep 16, 2024
@hediet hediet added this to the October 2024 milestone Sep 26, 2024
@hediet
Copy link
Member

hediet commented Sep 26, 2024

Thanks! Good observation! Out of curiosity, what made you look into the observable implementation?

@pisv
Copy link
Contributor Author

pisv commented Sep 26, 2024

Out of curiosity, what made you look into the observable implementation?

I'd like to port the 3-way merge editor from VS Code to Eclipse Theia, and it is heavily based on the observable framework :)

By the way, I really appreciate the clean code you have written! Great job 👍

@hediet hediet modified the milestones: October 2024, November 2024 Oct 24, 2024
@hediet hediet modified the milestones: November 2024, January 2025 Dec 5, 2024
@hediet hediet enabled auto-merge (squash) February 25, 2025 11:56
@hediet hediet force-pushed the cleanup-observable-jsdocs branch from 310e344 to 218b2ee Compare February 25, 2025 14:45
@aeschli aeschli added the postponed-during-endgame Endgame champ removed the planed milestone label Feb 27, 2025
@aeschli aeschli modified the milestones: February 2025, Backlog Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
postponed-during-endgame Endgame champ removed the planed milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants