Skip to content

Use app.createEventEmitter in QueryDiscovery#2437

Merged
robertbrignull merged 2 commits intomainfrom
robertbrignull/query-event-emitter
May 23, 2023
Merged

Use app.createEventEmitter in QueryDiscovery#2437
robertbrignull merged 2 commits intomainfrom
robertbrignull/query-event-emitter

Conversation

@robertbrignull
Copy link
Copy Markdown
Contributor

Remove a small dependency that QueryDiscovery has on VS Code classes. I'm not sure if this one is strictly a blocker for making unit tests, but the method on App is already there so it costs us nothing to use it.

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

@robertbrignull robertbrignull requested a review from a team May 22, 2023 15:11
@robertbrignull robertbrignull requested a review from a team as a code owner May 22, 2023 15:11
Copy link
Copy Markdown
Contributor

@shati-patel shati-patel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

private readonly onDidChangeQueriesEmitter = this.push(
new EventEmitter<void>(),
);
private readonly onDidChangeQueriesEmitter;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a type here? I think this is now typed as any.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks for pointing this out. For me locally it was working out the correct type. Perhaps it's smart enough to see the single assignment in the constructor.

But I do kinda like things to be explicit and readable to the human eye, so putting a type here sounds good to me regardless.

@robertbrignull robertbrignull merged commit f6b0ae2 into main May 23, 2023
@robertbrignull robertbrignull deleted the robertbrignull/query-event-emitter branch May 23, 2023 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants