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

Give the user a choice of implicit cradle (cabal, stack, etc) if there is more than one #742

Open
pepeiborra opened this issue Sep 13, 2020 · 9 comments
Labels
component: implicit-hie level: easy The issue is suited for beginners type: enhancement New feature or request

Comments

@pepeiborra
Copy link
Collaborator

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:

  1. Inform the user that there is no cradle haskell/ghcide#788
  2. Write the implicit cradle to disk
  3. Give the user a choice if there are both stack and cabal project descriptors
  4. Delete all the cradle files from ghcide and hls - no longer needed

Originally posted by @pepeiborra in haskell/ghcide#782 (comment)

@fendor
Copy link
Collaborator

fendor commented Sep 13, 2020

Additionally, it would be nice to define a default selection. E.g., personally I always want to use cabal and don't want to be asked again and again what type of cradle I want to have generated.

@pepeiborra
Copy link
Collaborator Author

Rather than a selection feature, just write it to disk?

@fendor
Copy link
Collaborator

fendor commented Sep 13, 2020

Yeah, that probably suffices, it is not that bad to select once per project what tool you want to use.

@jneira
Copy link
Member

jneira commented Sep 13, 2020

A init param and/or lsp client setting, --default-build-tool would be great for this and maybe could be used for other things

@pepeiborra
Copy link
Collaborator Author

Just keep things simple. Ask the user to pick Cabal or Stack, generate it and write it to disk. Zero configuration, fewer questions, hopefully less issues raised about it.

@pepeiborra
Copy link
Collaborator Author

In the cradle-less plan where the implicit cradle is always used by default, I can see how you need config in case there is more than one choice.
My preference would be for a 3-way option "Ask/Cabal/Stack" where Ask is the default value and the answer is recorded in the project file system (e.g. in vscode/settings.json but ideally somewhere more portable).

@alanz
Copy link
Collaborator

alanz commented Sep 14, 2020

Would the question be asked by means of window/showMessageRequest?

I would suggest storing the answer in a file in the project root, called something explicit like hie-implicit-choice, and populated with some explanation of what it means.

@jneira
Copy link
Member

jneira commented Sep 14, 2020

The settings.json belongs to the lsp spec, right? Any client can send a didChangeConfiguration request with the json so emacs, vim, etc can use it.
So i would use it instead add more config files.

@pepeiborra pepeiborra transferred this issue from haskell/ghcide Dec 30, 2020
@jneira jneira changed the title Give the user a choice of implicit cradle if there is more than one Give the user a choice of implicit cradle (cabal, stack, etc) if there is more than one Jun 17, 2021
@michaelpj michaelpj added level: easy The issue is suited for beginners and removed old_good first issue labels Jul 13, 2022
@michaelpj
Copy link
Collaborator

Related: #3832

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: implicit-hie level: easy The issue is suited for beginners type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants