Skip to content

Remove max number of problems config option #1567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 14, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down Expand Up @@ -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/)
Expand Down Expand Up @@ -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: <https://hackage.haskell.org/package/haskell-language-server>

## Configuring `haskell-language-server`

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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: <https://github.com/haskell/haskell-language-server/issues/478>.
This issue should be fixed in Stack versions >= 2.5.

#### Problems with dynamic linking
Expand Down Expand Up @@ -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:
Expand All @@ -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`
Expand Down
4 changes: 0 additions & 4 deletions hls-plugin-api/src/Ide/Plugin/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ data Config =
, checkProject :: !Bool
, hlintOn :: !Bool
, diagnosticsOnChange :: !Bool
, maxNumberOfProblems :: !Int
, diagnosticsDebounceDuration :: !Int
, liquidOn :: !Bool
, completionSnippetsOn :: !Bool
Expand All @@ -68,7 +67,6 @@ instance Default Config where
, checkProject = True
, hlintOn = True
, diagnosticsOnChange = True
, maxNumberOfProblems = 100
, diagnosticsDebounceDuration = 350000
, liquidOn = False
, completionSnippetsOn = True
Expand All @@ -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
Expand All @@ -111,7 +108,6 @@ instance A.ToJSON Config where
, "checkProject" .= checkProject
, "hlintOn" .= hlintOn
, "diagnosticsOnChange" .= diagnosticsOnChange
, "maxNumberOfProblems" .= maxNumberOfProblems
, "diagnosticsDebounceDuration" .= diagnosticsDebounceDuration
, "liquidOn" .= liquidOn
, "completionSnippetsOn" .= completionSnippetsOn
Expand Down