user5685: System Info:
Ubuntu :20.04
I am trying to get VSCode HLS extension working for plutus based project but seeing below error in output.
Failed to get project GHC version: no cradle
[Info  - 3:27:24 p.m.] Connection to server got closed. Server will restart.
No 'hie.yaml' found. Try to discover the project type!
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.7.0.0 x86_64 ghc-9.2.2
Current directory: /home/skb/dev/emurgoProject
Operating system: linux
Arguments: ["--lsp"]
Cradle directory: /home/skb/dev/emurgoProject
Cradle type: Stack

Tool versions found on the $PATH
cabal:      3.6.2.0
stack:      2.7.5
ghc:        8.10.7```

I have nix shell evnironment via this repo: https://github.com/input-output-hk/plutus-apps 
Below is what am doing:
1. Run **nix-shell** from root folder of plutus-apps repo.
2. cd (change dir) to my plutus project folder which I created based on: https://github.com/input-output-hk/plutus-starter
3. code . to open the vscode

Side note: HLS work for non plutus projects in my machine (when I am not running nix-shell).


user7251: 1 -
Try running first the nix shell in a terminal then, from inside the nix shell, go to your project folder, and run: code .
Than will open you project with vcode and all the terminals and the HSL will be inside the nix shell you activated before.
Also, you will need the HLS installed inside the nix shell, for that, the best is to use ghcup inside the nix shell, to make sure all is needed is known for nix. For that run: ghcup install
You can see if there is any problem with HLS in the Output console in vcode, and in the list of outputs choose Haskell.
'
That worked for me.
2 - For the cradle message, you can add a file in you root folder:
hie.yaml
and write this inside:
cradle:
  cabal:

3 -Im editing this with something also can work.
I was having problems with some errors and everything fixed when I deleted the cache file of hie-bios:
cd $HOME/.cache/
sudo rm -R  hie-bios

Check more solutions here:
https://haskell-language-server.readthedocs.io/en/latest/troubleshooting.html
4 - I found that haskell-server-language is installed already in the nix-shell of plutus-apps
Enter in the nix-shell and write:
> whereis haskell-language-server
> haskell-language-server: /nix/store/iy740dkx9anah9j04b4g3fnd7wjws3lm-haskell-language-server-exe-haskell-language-server-1.5.1.0/bin/haskell-language-server

Then in VCODE open you settings and put that into the serverExecutablePath field:
"haskell.serverExecutablePath": "/nix/store/iy740dkx9anah9j04b4g3fnd7wjws3lm-haskell-language-server-exe-haskell-language-server-1.5.1.0/bin/haskell-language-server"


5685: <p>System Info:
Ubuntu :20.04</p>
<p>I am trying to get VSCode HLS extension working for plutus based project but seeing below error in output.</p>
<pre><code>Failed to get project GHC version: no cradle
[Info  - 3:27:24 p.m.] Connection to server got closed. Server will restart.
No 'hie.yaml' found. Try to discover the project type!
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.7.0.0 x86_64 ghc-9.2.2
Current directory: /home/skb/dev/emurgoProject
Operating system: linux
Arguments: [&quot;--lsp&quot;]
Cradle directory: /home/skb/dev/emurgoProject
Cradle type: Stack

Tool versions found on the $PATH
cabal:      3.6.2.0
stack:      2.7.5
ghc:        8.10.7```

I have nix shell evnironment via this repo: https://github.com/input-output-hk/plutus-apps 
Below is what am doing:
1. Run **nix-shell** from root folder of plutus-apps repo.
2. cd (change dir) to my plutus project folder which I created based on: https://github.com/input-output-hk/plutus-starter
3. code . to open the vscode

Side note: HLS work for non plutus projects in my machine (when I am not running nix-shell).
</code></pre>
 7251: <p>1 -
Try running first the nix shell in a terminal then, from inside the nix shell, go to your project folder, and run: <code>code .</code></p>
<p>Than will open you project with vcode and all the terminals and the HSL will be inside the nix shell you activated before.</p>
<p>Also, you will need the HLS installed inside the nix shell, for that, the best is to use ghcup inside the nix shell, to make sure all is needed is known for nix. For that run: <code>ghcup install</code></p>
<p>You can see if there is any problem with HLS in the Output console in vcode, and in the list of outputs choose Haskell.</p>
<p><a href="https://i.stack.imgur.com/RRzc8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RRzc8.jpg" alt="enter image description here" /></a>'</p>
<p>That worked for me.</p>
<p>2 - For the cradle message, you can add a file in you root folder:
hie.yaml
and write this inside:</p>
<pre><code>cradle:
  cabal:
</code></pre>
<p>3 -Im editing this with something also can work.</p>
<p>I was having problems with some errors and everything fixed when I deleted the cache file of hie-bios:</p>
<pre><code>cd $HOME/.cache/
sudo rm -R  hie-bios
</code></pre>
<p>Check more solutions here:</p>
<p><a href="https://haskell-language-server.readthedocs.io/en/latest/troubleshooting.html" rel="nofollow noreferrer">https://haskell-language-server.readthedocs.io/en/latest/troubleshooting.html</a></p>
<p>4 - I found that haskell-server-language is installed already in the nix-shell of plutus-apps</p>
<p>Enter in the nix-shell and write:</p>
<pre><code>&gt; whereis haskell-language-server
&gt; haskell-language-server: /nix/store/iy740dkx9anah9j04b4g3fnd7wjws3lm-haskell-language-server-exe-haskell-language-server-1.5.1.0/bin/haskell-language-server
</code></pre>
<p>Then in VCODE open you settings and put that into the serverExecutablePath field:</p>
<pre><code>&quot;haskell.serverExecutablePath&quot;: &quot;/nix/store/iy740dkx9anah9j04b4g3fnd7wjws3lm-haskell-language-server-exe-haskell-language-server-1.5.1.0/bin/haskell-language-server&quot;
</code></pre>
