Skip to content

Conversation

@blackheaven
Copy link
Contributor

This aimes to fix #4665.

Note that I directly calling git, as th gitignore format is non-trivial.

I can roll a partial parsing implementation if requested.

@blackheaven blackheaven requested a review from wz1000 as a code owner October 4, 2025 16:42
@blackheaven blackheaven force-pushed the ghcide/use-gitignore branch 2 times, most recently from 013cd7b to 5db38c5 Compare October 4, 2025 16:52
@blackheaven
Copy link
Contributor Author

I don't think the CI failure is related to my PR.

@sgillespie
Copy link
Collaborator

I don't think the CI failure is related to my PR.

Looks like a flaky thing, it fixed itself

@blackheaven
Copy link
Contributor Author

Thanks, let's try again

Copy link
Collaborator

@fendor fendor left a comment

Choose a reason for hiding this comment

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

Small comments, otherwise LGTM!

Unfortunately, there are not automated tests for this cli mode, we'd need to add some, but that's some fair amount of work...

Copy link
Collaborator

@fendor fendor left a comment

Choose a reason for hiding this comment

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

Couple of issues when trying this patch on the HLS codebase, but otherwise I like the direction!

@blackheaven blackheaven force-pushed the ghcide/use-gitignore branch 2 times, most recently from dfa2415 to cc29abb Compare October 29, 2025 11:54
@blackheaven
Copy link
Contributor Author

I won't lie, I have no clue about the broken pipe on windows error is related to my change.

@fendor
Copy link
Collaborator

fendor commented Oct 29, 2025

@blackheaven it is not caused by you. As already said, iirc there is not a single test case for the code path you are changing, so you can safely ignore any CI failures except pre-commit and -Werror :D

@blackheaven
Copy link
Contributor Author

Thanks a lot

@fendor fendor added the status: needs review This PR is ready for review label Oct 29, 2025
Just _ -> \path -> do
let lookups =
if takeExtension path `elem` [".hs", ".lhs"]
then [path]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Question, what should happen if a user explicitly asks for a file to load, but the file is .gitignored?

Should we perhaps still load it? I feel like, that might be more natural behaviour, but I am admittedly not sure.
If we do want to ignore ignored files, then I would still suggest that we should warn the user in this case, that we ingored a file they requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: needs review This PR is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

typecheck should ignore .gitignore-ed files

3 participants