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

Included non-deps symbols in fuzzy matcher #704

Merged
merged 3 commits into from
Apr 23, 2024
Merged

Conversation

scohen
Copy link
Collaborator

@scohen scohen commented Apr 18, 2024

I noticed that the fuzzy matcher wouldn't match any unit tests. This is because their application is nil, as they're scripts. This change checks for nil applications, and if it finds one, only excludes the mapped entry if the path looks like it comes from a dependencies directory.

Note, the deps directory name is hard coded. I originally queried the project for the deps directory name, but this would include dependencies in the projects directory, which was quite annoying, hence the hard-coding.

I noticed that the fuzzy matcher wouldn't match any unit tests. This
is because their application is nil, as they're scripts.
This change checks for nil applications, and if it finds one, only
excludes the mapped entry if the path looks like it comes from a
dependencies directory.

Note, the deps directory name is hard coded. I originally queried the
project for the deps directory name, but this would include
dependencies in the projects directory, which was quite annoying,
hence the hard-coding.
@scohen scohen requested a review from zachallaun April 19, 2024 18:22
Dependencies are now detected via seeing if the path is in our deps
directory or one of our sub-project's dependencies.
@scohen
Copy link
Collaborator Author

scohen commented Apr 22, 2024

@zachallaun please take another look.

@scohen
Copy link
Collaborator Author

scohen commented Apr 22, 2024

FYI, @zachallaun the previous approach wouldn't allow searches for Lexical.Document to succeed either.

Copy link
Collaborator

@zachallaun zachallaun left a comment

Choose a reason for hiding this comment

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

Made a couple suggestions.

I do think this is a better approach than the previous iteration. One downside is that it finds the existing deps directories once when fuzzy is initialized, which means that any directories added later (from project restructuring/etc. maybe?) won't be ignored.

@scohen
Copy link
Collaborator Author

scohen commented Apr 23, 2024

One downside is that it finds the existing deps directories once when fuzzy is initialized

There's really no way to fix this. There is a lot of trouble with LSP file watching, several editors (emacs included) simply don't deliver didChangeWatchedFiles messages reliably, which is a shame.

@scohen scohen force-pushed the include-app-unit-tests branch from 1a3b623 to 1a9f403 Compare April 23, 2024 15:00
@scohen scohen merged commit 3833c18 into main Apr 23, 2024
9 checks passed
@scohen scohen deleted the include-app-unit-tests branch April 23, 2024 15:49
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.

2 participants