From 998d09f30f3e285e5f6894c99606c26978e9a01f Mon Sep 17 00:00:00 2001 From: Marc Scholten Date: Fri, 16 Sep 2022 08:43:08 +0200 Subject: [PATCH] Make editor docs more visible Fixes #1460 --- Guide/editors.markdown | 26 +++++++++++++++----------- Guide/installation.markdown | 6 +++--- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Guide/editors.markdown b/Guide/editors.markdown index 2623f2775..10e5af040 100644 --- a/Guide/editors.markdown +++ b/Guide/editors.markdown @@ -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 diff --git a/Guide/installation.markdown b/Guide/installation.markdown index 807063e27..2499d2fe4 100644 --- a/Guide/installation.markdown +++ b/Guide/installation.markdown @@ -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)