Skip to content

Apply language context to queries panel#2889

Merged
starcke merged 2 commits intomainfrom
starcke/lang-context-queries
Oct 2, 2023
Merged

Apply language context to queries panel#2889
starcke merged 2 commits intomainfrom
starcke/lang-context-queries

Conversation

@starcke
Copy link
Copy Markdown
Contributor

@starcke starcke commented Sep 29, 2023

This adds language filtering to the queries panel. Adding the filtering was trivial, however there were a few other tweaks I had to make.

  1. Previously we made onDidChangeQueries the same as onDidChangePathData. However if we integrated with that it would require a full rescan of the file system to apply a filter which felt quite slow for me. Instead we create a specific emitter for onDidChangeQueries which is triggered by either the filesystem changing or the filter changing.
  2. Initially my tests failed when trying to dispose this.languageContext.onLanguageContextChanged. This was because the MockApp created a MockEventEmitter which returned {} as disposable. However {} is actually not disposable (because it lacks the method). So I changed it to return something that is actually disposable.

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.

@starcke starcke force-pushed the starcke/lang-context-queries branch from 15d106a to 169a425 Compare September 29, 2023 09:07
@starcke starcke marked this pull request as ready for review September 29, 2023 09:28
@starcke starcke requested review from a team as code owners September 29, 2023 09:28
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.

This looks good to me! Works locally, and your explanations for onDidChangeQueries and the disposable make sense.

@starcke starcke merged commit 6e06e79 into main Oct 2, 2023
@starcke starcke deleted the starcke/lang-context-queries branch October 2, 2023 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants