Closed tomjaguarpaw closed 2 years ago
The number of people using .ghci files is decreasing rapidly because Cabal doesn't support them very well, thus I don't think that for most people specifying ghci files is a good idea. Unfortunately, there is no blanket answer as for how to configure things properly, and I don't think there will be for a while. I tweaked the message to:
No files loaded, GHCi not configured properly.
But I don't have anything better than that...
The number of people using .ghci files is decreasing rapidly because Cabal doesn't support them very well, thus I don't think that for most people specifying ghci files is a good idea.
I see. Perhaps it's a particularity of my setup that the "ghci wrapper" I provide doesn't load a module.
I tweaked the message to:
No files loaded, GHCi not configured properly.
But I don't have anything better than that...
How about saying exactly what the problem is? Something like "When ghcid runs the command that provides it with a GHCi session, that GHCi session must to load a module, but it didn't.". Then at least people have something to work with. "Not configured properly" just raises more questions.
No files were loaded by the supplied ghci command, which isn't allowed (no files to watch).
Thoughts?
Perhaps it's a particularity of my setup that the "ghci wrapper" I provide doesn't load a module.
I think most people use cabal repl
or stack repl
nowadays which might not load any modules, but usually due to errors in the setup rather than a missing .ghci
:load
entry.
No files were loaded by the supplied ghci command, which isn't allowed (no files to watch).
Thoughts?
Sounds good, though I'd probably suggest replacing "isn't allowed" to "means I can't do anything". It's not really forbidden it just doesn't do anything useful.
Perhaps it's a particularity of my setup that the "ghci wrapper" I provide doesn't load a module.
I think most people use cabal repl or stack repl nowadays which might not load any modules, but usually due to errors in the setup rather than a missing .ghci :load entry.
I see. Work has some Nix-based ghci wrapper and I guess it just doesn't load any modules unless I configure a .ghci
file.
It isn't allowed and will cause ghcid to abort (technically ghcid could just sit their watching no files, but while it is the correct zero-case behaviour, it's not actually what anyone wants)
It isn't allowed and will cause ghcid to abort (technically ghcid could just sit their watching no files, but while it is the correct zero-case behaviour, it's not actually what anyone wants)
Sure, but the user's next question will be "why isn't it allowed?" and the answer is "because if you don't load any modules then ghcid isn't useful". I'd suggest avoiding having the user ask themselves that question but just answering it directly in the error message.
Anyway, any of the messages we've suggested in this thread are better than the status quo.
No files loaded, meaning ghcid will never refresh, so aborting.
Thoughts?
I like that one!
Done! Thanks for your help refining this bit
If I run
without a
.ghci
file then I get the error messageFirstly, this is quite alarming. Secondly, I don't think it's correct. GHCi is working fine but it hasn't been correctly configured to work with
ghcid
. Would you be open to a different error message? I'm not sure I knowghcid
well enough to be able to make a good suggestion, but maybe something like:(
ghcid
could even check for the existence of that.ghci
file.)