<div dir="ltr"><div>I'm opening the project by running VS Code first, then opening the root folder of the project. I don't have a 'code' command installed or no path to it set; this doesn't happen by default on MacOS but I could look it up.</div><div><br></div><div>But I think I got a better clue by running haskell-language-server-wrapper:</div><div><br></div><div>I got this line.<br></div><div><span style="color:rgb(0,0,255)">Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.9.0.0 x86_64 ghc-9.4.4</span></div><div><br></div><div>And then:</div><div><span style="color:rgb(153,0,255)"><br></span></div><div><span style="color:rgb(0,0,255)">Tool versions found on the $PATH<br>cabal: 3.6.2.0<br>stack: 2.3.3<br>ghc: 8.10.7</span></div><div><br></div><div><span style="color:rgb(0,0,0)">My stack.yam<span style="font-family:arial,sans-serif"><font size="2">l is using the resolver <br></font></span></span><div style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Menlo,Monaco,"Courier New",monospace;font-weight:normal;font-size:12px;line-height:18px;white-space:pre"><div><span style="font-family:arial,sans-serif"><font size="2">lts-18.19</font></span></div><div><span style="font-family:arial,sans-serif"><font size="2">which does </font>specify GHC 8.10.7 according to what I looked up.</span></div><div><span style="font-family:arial,sans-serif"><br></span></div><div><span style="font-family:arial,sans-serif">But that ghc-9.4.4 seems to be a problem.</span></div><div><span style="font-family:arial,sans-serif"><br></span></div><div><span style="font-family:arial,sans-serif"><span style="color:rgb(0,0,255)"><span style="color:rgb(0,0,0)">Thanks! But how to fix?</span><br></span></span></div><div><span style="font-family:arial,sans-serif"><span style="color:rgb(0,0,255)"><br></span></span></div><div><span style="color:rgb(0,0,255)"><br></span></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 7, 2023 at 5:13 AM Fendor <<a href="mailto:power.walross@gmail.com">power.walross@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="padding-bottom:1px">
<p>How are you launching VSCode? Make sure you open the root of the
project in VSCode.<br>
Opening VSCode from the cli via `code .` when you are in the
correct directory is the most reliable.</p>
<p>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.<br>
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).</p>
<p>Best regards,<br>
Fendor<br>
</p>
<div>On 07/01/2023 10:00, Dennis Raddle
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>I'm trying to get HLS set up with a stack project on VS
Code. I'm getting messages like this:</div>
<div><br>
</div>
<div>Could not load module ‘Control.Monad.Except’<br>
It is a member of the hidden package ‘mtl-2.2.2’.<br>
You can run ‘:set -package mtl’ to expose it.<br>
(Note: this unloads all the modules in the current scope.)</div>
<div><br>
</div>
<div>But these are in the "Problems" tab of VS Code (and show as
red underlines).</div>
<div><br>
</div>
<div>When I run stack clean, stack build I don't see any error
like this at all. <br>
</div>
<div><br>
</div>
<div>And yes, I made sure mtl was added everywhere in cac.cabal.
(I'm using cac.cabal not stack.yaml... is that my problem?)</div>
<div><br>
</div>
<div>I tried stack clean; stack build; restart HLS several
times.</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a>
Only members subscribed via the mailman list are allowed to post.</pre>
</blockquote>
</div>
<u></u><u></u>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>