Skip to content

Conversation

hediet
Copy link
Member

@hediet hediet commented Jun 6, 2025

Fixes #242059 FYI @jrieken

The position cannot be wrong now anymore, as only "well behaving" observables are read. "Well behaving" observables ensure that dependencies always see globally consistent state.

The observableFromEvent was not well-behaving, as the text model change event fires (immediately triggering reactions) before other objects can update their data. This could cause the autorun to see inconsistent state.

editorObs.versionId uses editor transactions to avoid this problem.

@hediet hediet self-assigned this Jun 6, 2025
@hediet hediet enabled auto-merge (rebase) June 6, 2025 11:02
@vs-code-engineering vs-code-engineering bot added this to the June 2025 milestone Jun 6, 2025
@hediet hediet merged commit 4097467 into main Jun 6, 2025
8 checks passed
@hediet hediet deleted the hediet/b/usual-quokka branch June 6, 2025 11:15
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jul 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ITextModel.onDidChangeContent cannot be used with observableFromEvent
2 participants