Skip to content

Commit 1ca533f

Browse files
jneirapepeiborra
andauthored
Remove max number of problems config option (#1567)
* Remove maxNumberOfProblems and fix some markdownlint warnings * Remove maxNumberOfProblems Co-authored-by: Pepe Iborra <[email protected]>
1 parent cf50856 commit 1ca533f

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

Diff for: README.md

+15-5
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,17 @@ background](https://neilmitchell.blogspot.com/2020/01/one-haskell-ide-to-rule-th
6565

6666
- For cabal:
6767
- Add to your global config file (e.g. `~/.cabal/config`):
68-
```
68+
69+
```cabal
6970
program-default-options
7071
ghc-options: -haddock
7172
```
73+
7274
- Or, for a single project, run `cabal configure --ghc-options=-haddock`
7375
7476
- For stack, add to global `$STACK_ROOT\config.yaml`, or project's `stack.yaml`:
75-
```
77+
78+
```cabal
7679
ghc-options:
7780
"$everything": -haddock
7881
```
@@ -131,6 +134,7 @@ then it means you have the command in PATH.
131134
#### Linux-specific pre-requirements
132135
133136
On Linux you will need install a couple of extra libraries:
137+
134138
- [Unicode (ICU)](http://site.icu-project.org/)
135139
- [NCURSES](https://www.gnu.org/software/ncurses/)
136140
- [Zlib](https://zlib.net/)
@@ -260,7 +264,7 @@ Direct installation from Hackage, while possible via `cabal install haskell-lang
260264
Said command builds the `haskell-language-server` binary and installs it in the default Cabal binaries folder,
261265
but the binary will only work with projects that use the same GHC version that built it.
262266

263-
The package can be found here on Hackage: https://hackage.haskell.org/package/haskell-language-server
267+
The package can be found here on Hackage: <https://hackage.haskell.org/package/haskell-language-server>
264268

265269
## Configuring `haskell-language-server`
266270

@@ -301,9 +305,9 @@ For example, `haskell-language-server` allows you to choose the formatting provi
301305
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).
302306

303307
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:
308+
304309
- 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)
305310
- Format on imports (`haskell.formatOnImportOn`, default true): whether to format after adding an import
306-
- Maximum number of problems to report (`haskell.maxNumberOfProblems`, default 100): the maximum number of problems the server will send to the client
307311
- Diagnostics on change (`haskell.diagnosticsOnChange`, default true): (currently unused)
308312
- Completion snippets (`haskell.completionSnippetsOn`, default true): whether to support completion snippets
309313
- 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
631635
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.).
632636

633637
Example with `tasty-discover`:
638+
634639
```haskell
635640
{-# OPTIONS_GHC -F -pgmF tasty-discover #-}
636641
```
642+
637643
This returns an error in HLS if 'tasty-discover' is not in the path: `could not execute: tasty-discover`.
638644

639645
## Troubleshooting
@@ -642,7 +648,7 @@ This returns an error in HLS if 'tasty-discover' is not in the path: `could not
642648

643649
#### Difficulties with Stack and `Paths_` modules
644650

645-
These are known to be somewhat buggy at the moment: https://github.com/haskell/haskell-language-server/issues/478.
651+
These are known to be somewhat buggy at the moment: <https://github.com/haskell/haskell-language-server/issues/478>.
646652
This issue should be fixed in Stack versions >= 2.5.
647653

648654
#### Problems with dynamic linking
@@ -737,12 +743,15 @@ $ cabal build
737743
If you are looking for a Nix expression to create haskell-language-server binaries, see https://github.com/haskell/haskell-language-server/issues/122
738744

739745
#### Introduction tutorial
746+
740747
Pepeiborra [wrote an tutorial](https://github.com/pepeiborra/hls-tutorial) on writing a plugin in HLS.
741748

742749
#### Test your hacked HLS in your editor
750+
743751
If you want to test HLS while hacking on it, follow the steps below.
744752

745753
To do once:
754+
746755
- Open some codebase on which you want to test your hacked HLS in your favorite editor
747756
- Configure this editor to use your custom HLS executable
748757
- With Cabal:
@@ -751,6 +760,7 @@ To do once:
751760
- With Stack: `$(stack path --dist-dir)/build/haskell-language-server/haskell-language-server`
752761

753762
To do every time you changed code and want to test it:
763+
754764
- Build HLS
755765
- With Cabal: `cabal build exe:haskell-language-server`
756766
- With Stack: `stack build haskell-language-server:exe:haskell-language-server`

Diff for: hls-plugin-api/src/Ide/Plugin/Config.hs

-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ data Config =
5252
, checkProject :: !Bool
5353
, hlintOn :: !Bool
5454
, diagnosticsOnChange :: !Bool
55-
, maxNumberOfProblems :: !Int
5655
, diagnosticsDebounceDuration :: !Int
5756
, liquidOn :: !Bool
5857
, completionSnippetsOn :: !Bool
@@ -68,7 +67,6 @@ instance Default Config where
6867
, checkProject = True
6968
, hlintOn = True
7069
, diagnosticsOnChange = True
71-
, maxNumberOfProblems = 100
7270
, diagnosticsDebounceDuration = 350000
7371
, liquidOn = False
7472
, completionSnippetsOn = True
@@ -94,7 +92,6 @@ parseConfig defValue = A.withObject "Config" $ \v -> do
9492
<*> (o .:? "checkProject" <|> v .:? "checkProject") .!= checkProject defValue
9593
<*> o .:? "hlintOn" .!= hlintOn defValue
9694
<*> o .:? "diagnosticsOnChange" .!= diagnosticsOnChange defValue
97-
<*> o .:? "maxNumberOfProblems" .!= maxNumberOfProblems defValue
9895
<*> o .:? "diagnosticsDebounceDuration" .!= diagnosticsDebounceDuration defValue
9996
<*> o .:? "liquidOn" .!= liquidOn defValue
10097
<*> o .:? "completionSnippetsOn" .!= completionSnippetsOn defValue
@@ -111,7 +108,6 @@ instance A.ToJSON Config where
111108
, "checkProject" .= checkProject
112109
, "hlintOn" .= hlintOn
113110
, "diagnosticsOnChange" .= diagnosticsOnChange
114-
, "maxNumberOfProblems" .= maxNumberOfProblems
115111
, "diagnosticsDebounceDuration" .= diagnosticsDebounceDuration
116112
, "liquidOn" .= liquidOn
117113
, "completionSnippetsOn" .= completionSnippetsOn

0 commit comments

Comments
 (0)