[Haskell-cafe] HLS in VS Code is identifying problems that don't when I run stack on the command line

Fendor power.walross at gmail.com
Sat Jan 7 10:13:36 UTC 2023

How are you launching VSCode? Make sure you open the root of the project 
in VSCode.
Opening VSCode from the cli via `code .` when you are in the correct 
directory is the most reliable.

Further, on the cli, try running HLS like this: 
`haskell-language-server-wrapper --debug <some-path-to-a-source-file>` 
from the root of your project.
Does this report the same error? If yes, more info about the project is 
needed like the .cabal file and the logs. Otherwise, it is a problem 
with the editor (e.g., PATH variable shenanigans).

Best regards,

On 07/01/2023 10:00, Dennis Raddle wrote:
> I'm trying to get HLS set up with a stack project on VS Code. I'm 
> getting messages like this:
> Could not load module ‘Control.Monad.Except’
> It is a member of the hidden package ‘mtl-2.2.2’.
> You can run ‘:set -package mtl’ to expose it.
> (Note: this unloads all the modules in the current scope.)
> But these are in the "Problems" tab of VS Code (and show as red 
> underlines).
> When I run stack clean, stack build I don't see any error like this at 
> all.
> And yes, I made sure mtl was added everywhere in cac.cabal. (I'm using 
> cac.cabal not stack.yaml... is that my problem?)
> I tried stack clean; stack build; restart HLS several times.
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20230107/29bc8b54/attachment.html>

More information about the Haskell-Cafe mailing list