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

fix(fs): avoid infinite loop searching parent dir #86

Merged
merged 1 commit into from
Jul 30, 2024
Merged

fix(fs): avoid infinite loop searching parent dir #86

merged 1 commit into from
Jul 30, 2024

Conversation

TheLeoP
Copy link
Contributor

@TheLeoP TheLeoP commented Jul 30, 2024

Fixes #83

@TheLeoP TheLeoP requested a review from gorillamoe as a code owner July 30, 2024 03:34
@gorillamoe
Copy link
Member

Thanks for making Kulala a better tool for everyone.

I'm not sure if this is the right approach to deal with it.. If I understand it correctly it will just look up one dir, right?

If so, I wont have that PR getting merged, as is, but will propose a different solution to the problem, because the spec clearly says, that it will traverse the whole directory tree upwards, until it finds a file.

@gorillamoe gorillamoe self-assigned this Jul 30, 2024
@gorillamoe gorillamoe added the bug Something isn't working label Jul 30, 2024
@gorillamoe
Copy link
Member

I have to correct myself; it's not the spec that says it, but some other clients do it this way e.g. visual studio

The environment file doesn't have to be in the project folder. Visual Studio looks for an environment file in the folder where the .http file exists. If it's not in that folder, Visual Studio looks through the parent directories to find it. When a file named http-client.env.json is found, the search ends. The file found nearest to the .http file is used.

@TheLeoP
Copy link
Contributor Author

TheLeoP commented Jul 30, 2024

If I understand it correctly it will just look up one dir, right?

No. It will always stop after finding the first file (hence the limit =1). It just handles better not getting stuck in an infinite loop

@gorillamoe gorillamoe merged commit 8995170 into mistweaverco:main Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: [windows] while using oil.nvim find_file_in_parent_dirs creates an infiinte looop
2 participants