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

Checking if a file is a res file #543

Merged
merged 4 commits into from
Aug 3, 2022
Merged

Checking if a file is a res file #543

merged 4 commits into from
Aug 3, 2022

Conversation

zth
Copy link
Collaborator

@zth zth commented Aug 2, 2022

This is a continuation of #539

@zth zth requested a review from cristianoc August 2, 2022 16:28
@@ -82,7 +82,7 @@ let inlay ~path ~pos ~maxLength ~debug =
Ast_iterator.default_iterator.value_binding iterator vb
in
let iterator = {Ast_iterator.default_iterator with value_binding} in
(if Files.exists path && Filename.check_suffix path ".res" then
(if Files.isResFile path then
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure that this does it.
The temptation could be else ... for .resi files which would leak to a crash.
Any other ideas?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Check the latest commit, what do you think about that? Slightly harder at to accidentally do the wrong thing at least I think, but still not fool proof.

Copy link
Collaborator

@cristianoc cristianoc left a comment

Choose a reason for hiding this comment

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

Great?
"classifySourceFile"

@zth
Copy link
Collaborator Author

zth commented Aug 3, 2022

Fixed the name! Merging now.

@zth zth merged commit 1874101 into master Aug 3, 2022
@zth zth deleted the safe-check-file-extension branch August 3, 2022 18:57
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