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

Make it possible to search for config without getCurrentDirectory #482

Closed

Conversation

jhrcek
Copy link

@jhrcek jhrcek commented Jun 27, 2024

An attempt to resolve #478

The intention is to make it possible to avoid dependency on getCurrentDirectory (which is problematic in haskell-language-server where multiple things running concurrently might depend on current directory and having to setCurrentDirectory just for stylish-haskell to be able to find the right config might lead to various race conditions).

The way to achieve it is to introduce new datatype ConfigSearchStrategy whose constructor SearchFromDirectory startDir makes it possible to supply a directory explicitly.

See this HLS PR for an example of how this new functionality would be used: haskell/haskell-language-server#4338

@jhrcek jhrcek marked this pull request as ready for review June 27, 2024 06:45
CHANGELOG Outdated Show resolved Hide resolved
@jhrcek
Copy link
Author

jhrcek commented Jun 28, 2024

Hello @jaspervdj
could you please check this when you have some time?

@jhrcek jhrcek marked this pull request as draft June 29, 2024 18:00
@jhrcek
Copy link
Author

jhrcek commented Jun 29, 2024

Converting to draft while I'm groping in the dark, trying to make CI pass..

@jaspervdj
Copy link
Member

Actually feel free to leave the CI changes out, I can try to get them in as a separate PR.

@jhrcek jhrcek closed this Jun 30, 2024
@jhrcek jhrcek deleted the jhrcek/loadConfig-avoid-getCurrentDirectory branch June 30, 2024 04:55
@jhrcek
Copy link
Author

jhrcek commented Jun 30, 2024

Ok, thank you.
Forgive my sausage fingers, I wanted to force push (-f) the branch with CI change commits reset but instead I deleted the branch in my remote (-d) 😅 I reopened the PR in #483

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.

add loadConfig that do not depend on CWD
2 participants