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

ITextModel.onDidChangeContent cannot be used with observableFromEvent #242059

Open
jrieken opened this issue Feb 26, 2025 · 0 comments
Open

ITextModel.onDidChangeContent cannot be used with observableFromEvent #242059

jrieken opened this issue Feb 26, 2025 · 0 comments
Assignees
Labels
debt Code quality issues
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented Feb 26, 2025

See

// DEBT - I cannot use `model.onDidChangeContent` directly here
// https://github.com/microsoft/vscode/issues/242059
const emitter = store.add(new Emitter<void>());
store.add(model.onDidChangeContent(() => emitter.fire()));
observableFromEvent(emitter.event, () => model.getVersionId()).read(r);

I had to do the weird workaround with the extra emitter because the onDidChangeContent event seems to be special

@hediet hediet added the debt Code quality issues label Feb 26, 2025
@hediet hediet added this to the March 2025 milestone Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Code quality issues
Projects
None yet
Development

No branches or pull requests

2 participants