From 52dcb439d5968e8d14f2203b3cc5a779dc0f1a04 Mon Sep 17 00:00:00 2001 From: jneira Date: Sat, 13 Mar 2021 16:09:59 +0100 Subject: [PATCH 1/2] Remove maxNumberOfProblems and fix some markdownlint warnings --- README.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f289ed24fa..728406559a 100644 --- a/README.md +++ b/README.md @@ -65,14 +65,17 @@ background](https://neilmitchell.blogspot.com/2020/01/one-haskell-ide-to-rule-th - For cabal: - Add to your global config file (e.g. `~/.cabal/config`): - ``` + + ```cabal program-default-options ghc-options: -haddock ``` + - Or, for a single project, run `cabal configure --ghc-options=-haddock` - For stack, add to global `$STACK_ROOT\config.yaml`, or project's `stack.yaml`: - ``` + + ```cabal ghc-options: "$everything": -haddock ``` @@ -131,6 +134,7 @@ then it means you have the command in PATH. #### Linux-specific pre-requirements On Linux you will need install a couple of extra libraries: + - [Unicode (ICU)](http://site.icu-project.org/) - [NCURSES](https://www.gnu.org/software/ncurses/) - [Zlib](https://zlib.net/) @@ -260,7 +264,7 @@ Direct installation from Hackage, while possible via `cabal install haskell-lang Said command builds the `haskell-language-server` binary and installs it in the default Cabal binaries folder, but the binary will only work with projects that use the same GHC version that built it. -The package can be found here on Hackage: https://hackage.haskell.org/package/haskell-language-server +The package can be found here on Hackage: ## Configuring `haskell-language-server` @@ -301,9 +305,9 @@ For example, `haskell-language-server` allows you to choose the formatting provi This option obviously would not make sense for language servers for other languages, or even for other Haskell language servers (which need not even support formatting). Here is a list of the additional settings currently supported by `haskell-language-server`, along with their setting key (you may not need to know this) and default: + - Formatting provider (`haskell.formattingProvider`, default `ormolu`): what formatter to use; one of `floskell`, `ormolu`, `fourmolu`, `stylish-haskell`, or `brittany` (if compiled with the brittany plugin) - Format on imports (`haskell.formatOnImportOn`, default true): whether to format after adding an import -- Maximum number of problems to report (`haskell.maxNumberOfProblems`, default 100): the maximum number of problems the server will send to the client - Diagnostics on change (`haskell.diagnosticsOnChange`, default true): (currently unused) - Completion snippets (`haskell.completionSnippetsOn`, default true): whether to support completion snippets - Liquid Haskell (`haskell.liquidOn`, default false): whether to enable Liquid Haskell support (currently unused until the Liquid Haskell support is functional again) @@ -631,9 +635,11 @@ tracked in https://github.com/haskell/haskell-language-server/issues/176 and ori As a workaround, you need to ensure the preprocessor is available in the path (install globally with Stack or Cabal, provide in `shell.nix`, etc.). Example with `tasty-discover`: + ```haskell {-# OPTIONS_GHC -F -pgmF tasty-discover #-} ``` + This returns an error in HLS if 'tasty-discover' is not in the path: `could not execute: tasty-discover`. ## Troubleshooting @@ -642,7 +648,7 @@ This returns an error in HLS if 'tasty-discover' is not in the path: `could not #### Difficulties with Stack and `Paths_` modules -These are known to be somewhat buggy at the moment: https://github.com/haskell/haskell-language-server/issues/478. +These are known to be somewhat buggy at the moment: . This issue should be fixed in Stack versions >= 2.5. #### Problems with dynamic linking @@ -737,12 +743,15 @@ $ cabal build If you are looking for a Nix expression to create haskell-language-server binaries, see https://github.com/haskell/haskell-language-server/issues/122 #### Introduction tutorial + Pepeiborra [wrote an tutorial](https://github.com/pepeiborra/hls-tutorial) on writing a plugin in HLS. #### Test your hacked HLS in your editor + If you want to test HLS while hacking on it, follow the steps below. To do once: + - Open some codebase on which you want to test your hacked HLS in your favorite editor - Configure this editor to use your custom HLS executable - With Cabal: @@ -751,6 +760,7 @@ To do once: - With Stack: `$(stack path --dist-dir)/build/haskell-language-server/haskell-language-server` To do every time you changed code and want to test it: + - Build HLS - With Cabal: `cabal build exe:haskell-language-server` - With Stack: `stack build haskell-language-server:exe:haskell-language-server` From b0e238aafa8574caa2c469b7d0308840ca683d48 Mon Sep 17 00:00:00 2001 From: jneira Date: Sat, 13 Mar 2021 16:15:14 +0100 Subject: [PATCH 2/2] Remove maxNumberOfProblems --- hls-plugin-api/src/Ide/Plugin/Config.hs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hls-plugin-api/src/Ide/Plugin/Config.hs b/hls-plugin-api/src/Ide/Plugin/Config.hs index fd5b9c5329..888ea7e6cf 100644 --- a/hls-plugin-api/src/Ide/Plugin/Config.hs +++ b/hls-plugin-api/src/Ide/Plugin/Config.hs @@ -52,7 +52,6 @@ data Config = , checkProject :: !Bool , hlintOn :: !Bool , diagnosticsOnChange :: !Bool - , maxNumberOfProblems :: !Int , diagnosticsDebounceDuration :: !Int , liquidOn :: !Bool , completionSnippetsOn :: !Bool @@ -68,7 +67,6 @@ instance Default Config where , checkProject = True , hlintOn = True , diagnosticsOnChange = True - , maxNumberOfProblems = 100 , diagnosticsDebounceDuration = 350000 , liquidOn = False , completionSnippetsOn = True @@ -94,7 +92,6 @@ parseConfig defValue = A.withObject "Config" $ \v -> do <*> (o .:? "checkProject" <|> v .:? "checkProject") .!= checkProject defValue <*> o .:? "hlintOn" .!= hlintOn defValue <*> o .:? "diagnosticsOnChange" .!= diagnosticsOnChange defValue - <*> o .:? "maxNumberOfProblems" .!= maxNumberOfProblems defValue <*> o .:? "diagnosticsDebounceDuration" .!= diagnosticsDebounceDuration defValue <*> o .:? "liquidOn" .!= liquidOn defValue <*> o .:? "completionSnippetsOn" .!= completionSnippetsOn defValue @@ -111,7 +108,6 @@ instance A.ToJSON Config where , "checkProject" .= checkProject , "hlintOn" .= hlintOn , "diagnosticsOnChange" .= diagnosticsOnChange - , "maxNumberOfProblems" .= maxNumberOfProblems , "diagnosticsDebounceDuration" .= diagnosticsDebounceDuration , "liquidOn" .= liquidOn , "completionSnippetsOn" .= completionSnippetsOn