Skip to content

Commit

Permalink
Make editor docs more visible
Browse files Browse the repository at this point in the history
Fixes #1460
  • Loading branch information
mpscholten committed Sep 16, 2022
1 parent 5aed140 commit 998d09f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
26 changes: 15 additions & 11 deletions Guide/editors.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,30 @@ To make file paths clickable inside the web browser (e.g. when a type error happ
export IHP_EDITOR="code --goto"
```

**Video Tutorial:**

You can also [watch "IHP + Visual Studio Code: Autocompletion & Smart IDE Features with Haskell Language Server" on Youtube](https://www.youtube.com/watch?v=_8_8XYO6rgY)

### VSCode + Haskell Language Server Troubleshooting

#### "Couldn't figure out what GHC version the project is using"
- **`"Couldn't figure out what GHC version the project is using"`**

If you get an error `Couldn't figure out what GHC version the project is using` in Visual Studio Code make sure that the Nix Env Selector plugin was started correctly:
If you get an error `Couldn't figure out what GHC version the project is using` in Visual Studio Code make sure that the Nix Env Selector plugin was started correctly:

1. Open the project in VS Code
2. Click `View` -> `Command Palette` -> `Nix-Env: Select Environment` -> `default.nix`
3. This will restart VS Code. After that Haskell Language Server should be working.
1. Open the project in VS Code
2. Click `View` -> `Command Palette` -> `Nix-Env: Select Environment` -> `default.nix`
3. This will restart VS Code. After that Haskell Language Server should be working.

#### "Failed to get project GHC executable path: CradleError"
- **`"Failed to get project GHC executable path: CradleError"`**

If you get an error `Failed to get project GHC executable path` with a `CradleError`, check your Haskell extension's settings and make sure you are using `"haskell.manageHLS": "PATH"`:
If you get an error `Failed to get project GHC executable path` with a `CradleError`, check your Haskell extension's settings and make sure you are using `"haskell.manageHLS": "PATH"`:

1. Open the project in VS Code
2. Click `Extensions` (`Ctrl + Shift + X`) -> Right-click `Haskell` -> `Extension Settings` -> `Haskell: Manage HLS` -> `PATH`
1. Open the project in VS Code
2. Click `Extensions` (`Ctrl + Shift + X`) -> Right-click `Haskell` -> `Extension Settings` -> `Haskell: Manage HLS` -> `PATH`

This error happens because the `GHCup` setting ignores all `PATH` variables pointing to `HLS` and instead uses the `/home/$USER/.cache/ghcup` directory. This is contrary to IHP's usage of Nix which places the necessary tooling into your `PATH` whenever your Nix environment is selected.
This error happens because the `GHCup` setting ignores all `PATH` variables pointing to `HLS` and instead uses the `/home/$USER/.cache/ghcup` directory. This is contrary to IHP's usage of Nix which places the necessary tooling into your `PATH` whenever your Nix environment is selected.

A caveat of this fix is that every time you want to use GHCup for tooling version management, you'll need to switch the setting back. The reason for this can be found in [this issue](https://github.com/haskell/vscode-haskell/issues/387).
A caveat of this fix is that every time you want to use GHCup for tooling version management, you'll need to switch the setting back. The reason for this can be found in [this issue](https://github.com/haskell/vscode-haskell/issues/387).

### VSCode on Windows with Windows Subsystem for Linux

Expand Down
6 changes: 3 additions & 3 deletions Guide/installation.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ If you want to try it out before making your own repo, use this button below:

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/gitpod-io/template-ihp)

## 3. Next
## 3. Setting up your editor

Setting up your editor
Also check this out if you're editor is already set up. You might miss a plugin that's recommended for IHP to work well.

- [VS Code](https://ihp.digitallyinduced.com/Guide/editors.html#using-ihp-with-visual-studio-code-vscode)
- [VS Code](https://ihp.digitallyinduced.com/Guide/editors.html#using-ihp-with-visual-studio-code-vscode) **Don't have nix-env-selector installed? Read this link**
- [Sublime Text](https://ihp.digitallyinduced.com/Guide/editors.html#using-ihp-with-sublime-text)
- [Emacs](https://ihp.digitallyinduced.com/Guide/editors.html#using-ihp-with-emacs)
- [Vim / NeoVim](https://ihp.digitallyinduced.com/Guide/editors.html#using-ihp-with-vim-neovim)
Expand Down

0 comments on commit 998d09f

Please sign in to comment.