Skip to content

ITextModel.onDidChangeContent cannot be used with observableFromEvent #242059

@jrieken

Description

@jrieken

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

Metadata

Metadata

Assignees

Labels

debtCode quality issuesinsiders-releasedPatch has been released in VS Code Insiders

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions