Skip to content

Commit

Permalink
scoped context key services fire on their own emitter but expose a co…
Browse files Browse the repository at this point in the history
…mposite event, #71642
  • Loading branch information
jrieken committed Apr 3, 2019
1 parent 2506981 commit 25f9be4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/vs/platform/contextkey/browser/contextKeyService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export abstract class AbstractContextKeyService implements IContextKeyService {
if (this._isDisposed) {
throw new Error(`AbstractContextKeyService has been disposed`);
}
return new ScopedContextKeyService(this, this._onDidChangeContext, domNode);
return new ScopedContextKeyService(this, domNode);
}

public contextMatchesRules(rules: ContextKeyExpr | undefined): boolean {
Expand Down Expand Up @@ -379,10 +379,9 @@ class ScopedContextKeyService extends AbstractContextKeyService {
private _parent: AbstractContextKeyService;
private _domNode: IContextKeyServiceTarget | undefined;

constructor(parent: AbstractContextKeyService, emitter: PauseableEmitter<IContextKeyChangeEvent>, domNode?: IContextKeyServiceTarget) {
constructor(parent: AbstractContextKeyService, domNode?: IContextKeyServiceTarget) {
super(parent.createChildContext());
this._parent = parent;
this._onDidChangeContext = emitter;

if (domNode) {
this._domNode = domNode;
Expand All @@ -400,7 +399,7 @@ class ScopedContextKeyService extends AbstractContextKeyService {
}

public get onDidChangeContext(): Event<IContextKeyChangeEvent> {
return this._parent.onDidChangeContext;
return Event.any(this._parent.onDidChangeContext, this._onDidChangeContext.event);
}

public getContextValuesContainer(contextId: number): Context {
Expand Down

0 comments on commit 25f9be4

Please sign in to comment.