-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
Write the implicit cradle to disk #837
Comments
Does this implicit cradle stuff flow into HLS when we upgrade ghcide for free? Or is this something we need to duplicate there? |
What should happen if there is already a Also, regarding generation, e.g. for recent cabal versions:
should be sufficient. Should we think about a backwards compatibility story? |
Flows for free |
Then we are not in the implicit case
That's implicit-hie responsibility. I don't have a view |
My hope was that the implicit cradle were good enough to not write the file and to remove the need of EDIT: I still hope that someday we will be able to not make users write the build info twice (or even make the tool write for them a second one on disk) |
My original intent was to write a The issue with this approach was invalidating a previously generated config. I believe what we had talked about over at the hls repo was a lsp action to generate a config, rather than always writing the config out. That way of you use common stanzas or cabal conditionals you could have a place to start from without us having to worry about invalidation. I am not against always generating writing a config to disk, but the auto generated file could not be named |
I don't follow. The implicit case only arises when there exists no cradle in disk. Therefore there is no risk of invalidating anything. The generated file could have a header "# Autogenerated by gen-hie on 01-01-2001" and instructions on how to regenerate it. |
Let's say you add a component to your project. If you used If we want to handle cradle generation automatically in a noob friendly way we need to handle changes in component structure. I think writing the config to the LSP log is a better option, but unconditionally generating a lower presence yaml config could also work. Sparsely parsing the cabal file and generating |
Agree with @Avi-D-coder, write the main config file without user control has its own caveats:
So to have an alternative config file until we have a code action/config option to generate the file on explicit user demand seems to be a better option. |
I see, so you want to make No need to write the implicit cradle to disk then. Assuming it always does the right thing, it's an unnecessary ugliness and best not recorded in the file system. |
@pepeiborra we are mostly happily using implicit-hie-cradle, would be some of the follow-ups still needed? Maybe
|
Happy to close this task and open new ones for follow-ups when/if reported |
I think this is great and I'm happy to merge it, but I have a couple of requests that can either be done in this PR of in follow-ups:
Originally posted by @pepeiborra in haskell/ghcide#782 (comment)
The text was updated successfully, but these errors were encountered: