packages feed

haskell-language-server 1.4.0.0 → 1.5.0.0

raw patch · 72 files changed

+243/−844 lines, 72 filesdep −ghc-api-compatdep ~ghcidedep ~hls-eval-plugindep ~hls-tactics-pluginPVP ok

version bump matches the API change (PVP)

Dependencies removed: ghc-api-compat

Dependency ranges changed: ghcide, hls-eval-plugin, hls-tactics-plugin

API changes (from Hackage documentation)

Files

ChangeLog.md view
@@ -1,5 +1,178 @@ # Changelog for haskell-language-server +## 1.5.0++Time for another hls release:++- @pepeiborra has done an epic work to improve performance, redefining some of the core pieces of HLS+  - You can take an overall look to improvements in [these slides](https://drive.google.com/file/d/16FpmiHXX_rd2gAf5XVgWAIr4kg-AkUqX/view)+- We have fourmolu support for ghc-9.0.1 thanks to @georgefst+- We have got improvements over import suggestions thanks to @yoshitsugu and @alexnaspo+- Completions also has been improved in general thanks to @pepeiborra+- There have been lot of documentation updates by several contributors, thanks also to all of you+- In this release we still don't have full support for all plugins and ghc-9.0.1+  - Missing plugins for ghc-9.0.1 are: hls-class-plugin, hls-tactics-plugin (wingman), hls-brittany-plugin and hls-stylish-haskell-plugin++### Deprecation notice for 1.5.0++- As we noted in the previous release we have dropped support for ghc versions 8.6.4, 8.10.2, 8.10.3, 8.10.4 in *this release*+- We will drop support for ghc versions 8.10.5 and 8.8.3 *after this release*+- The advise is upgrade ghc to the last minor version: 8.6.5, 8.8.4 or 8.10.7+- You can read more about ghc deprecation policy and schedule [here](https://haskell-language-server.readthedocs.io/en/latest/supported-versions.html)++### Pull requests merged for 1.5.0++- More completion fixes+([#2354](https://github.com/haskell/haskell-language-server/pull/2354)) by @pepeiborra+- Update to latest prettyprinter API+([#2352](https://github.com/haskell/haskell-language-server/pull/2352)) by @fendor+- Use hackage version of czipwith+([#2346](https://github.com/haskell/haskell-language-server/pull/2346)) by @jneira+- Show build graph statistics in ghcide-bench+([#2343](https://github.com/haskell/haskell-language-server/pull/2343)) by @pepeiborra+- contributing: add implicit-hie gen-hie > hie.yaml note+([#2341](https://github.com/haskell/haskell-language-server/pull/2341)) by @Anton-Latukha+- add dependabot: add Actions CI merge requests automation+([#2339](https://github.com/haskell/haskell-language-server/pull/2339)) by @Anton-Latukha+- Skip parsing without haddock for above GHC9.0+([#2338](https://github.com/haskell/haskell-language-server/pull/2338)) by @yoshitsugu+- Give unique names to post-jobs+([#2337](https://github.com/haskell/haskell-language-server/pull/2337)) by @jneira+- Cancel prev runs for bench and nix+([#2335](https://github.com/haskell/haskell-language-server/pull/2335)) by @jneira+- Trace diagnostics+([#2333](https://github.com/haskell/haskell-language-server/pull/2333)) by @pepeiborra+- Include sortText in completions and improve suggestions+([#2332](https://github.com/haskell/haskell-language-server/pull/2332)) by @pepeiborra+- Not suggest exported imports+([#2329](https://github.com/haskell/haskell-language-server/pull/2329)) by @yoshitsugu+- Update troubleshooting section+([#2326](https://github.com/haskell/haskell-language-server/pull/2326)) by @jneira+- Remove automatic comment to [skip circleci]+([#2325](https://github.com/haskell/haskell-language-server/pull/2325)) by @jneira+- Add README.md in install/ subproject+([#2324](https://github.com/haskell/haskell-language-server/pull/2324)) by @sir4ur0n+- Improve the performance of GetModIfaceFromDisk in large repos and delete GetDependencies+([#2323](https://github.com/haskell/haskell-language-server/pull/2323)) by @pepeiborra+- Add support for install hls from hackage using ghc 9.0.1+([#2322](https://github.com/haskell/haskell-language-server/pull/2322)) by @jneira+- Rename hlint test data files and add regression tests+([#2321](https://github.com/haskell/haskell-language-server/pull/2321)) by @jneira+- Suggest hiding imports when local definition exists+([#2320](https://github.com/haskell/haskell-language-server/pull/2320)) by @yoshitsugu+- Improve trace readability+([#2319](https://github.com/haskell/haskell-language-server/pull/2319)) by @pepeiborra+- Sir4ur0n/doc/cleanup hie+([#2311](https://github.com/haskell/haskell-language-server/pull/2311)) by @sir4ur0n+- Add option to effectively cancel prev runs+([#2310](https://github.com/haskell/haskell-language-server/pull/2310)) by @jneira+- Separate features from demos+([#2307](https://github.com/haskell/haskell-language-server/pull/2307)) by @jneira+- Prevent Tactics hover provider from blocking at startup+([#2306](https://github.com/haskell/haskell-language-server/pull/2306)) by @pepeiborra+- Fix defaultIdeOptions to use the initial config settings+([#2302](https://github.com/haskell/haskell-language-server/pull/2302)) by @pepeiborra+- Use new queue rules for mergify bot+([#2301](https://github.com/haskell/haskell-language-server/pull/2301)) by @jneira+- Fix reverse dep. tracking for alwaysRerun rules+([#2298](https://github.com/haskell/haskell-language-server/pull/2298)) by @pepeiborra+- Reorganize github workflows and use specific label [skip circleci]+([#2297](https://github.com/haskell/haskell-language-server/pull/2297)) by @jneira+- Enable func-test suite for windows+([#2296](https://github.com/haskell/haskell-language-server/pull/2296)) by @jneira+- Generate linkables in the Eval plugin+([#2295](https://github.com/haskell/haskell-language-server/pull/2295)) by @pepeiborra+- [hls-graph] clean up databaseDirtySet+([#2294](https://github.com/haskell/haskell-language-server/pull/2294)) by @pepeiborra+- Update link to supported platforms by ghcup+([#2293](https://github.com/haskell/haskell-language-server/pull/2293)) by @chshersh+- Make circleci honour [skip ci] wherever is placed in the pr info (title, description)+([#2289](https://github.com/haskell/haskell-language-server/pull/2289)) by @jneira+- Note in the install script that listed ghcs are the supported ones+([#2286](https://github.com/haskell/haskell-language-server/pull/2286)) by @jneira+- Move hlint tests to its own package (and other clean ups)+([#2284](https://github.com/haskell/haskell-language-server/pull/2284)) by @jneira+- Trace rebuilds+([#2283](https://github.com/haskell/haskell-language-server/pull/2283)) by @pepeiborra+- Fix excessive interface recompilation caused by the Tactics plugin+([#2282](https://github.com/haskell/haskell-language-server/pull/2282)) by @pepeiborra+- Preserve dirty set and add dirtiness assertion+([#2279](https://github.com/haskell/haskell-language-server/pull/2279)) by @pepeiborra+- Ignore null WatchedFile events+([#2278](https://github.com/haskell/haskell-language-server/pull/2278)) by @pepeiborra+- Trace log events and fix ghcide logger+([#2277](https://github.com/haskell/haskell-language-server/pull/2277)) by @pepeiborra+- Point to GitHub from Contributing.md+([#2275](https://github.com/haskell/haskell-language-server/pull/2275)) by @georgefst+- installation.md: add Fedora copr repo+([#2274](https://github.com/haskell/haskell-language-server/pull/2274)) by @juhp+- avoid double rebuilds for FOIs+([#2266](https://github.com/haskell/haskell-language-server/pull/2266)) by @pepeiborra+- Update installation on ArchLinux - new package+([#2265](https://github.com/haskell/haskell-language-server/pull/2265)) by @marcin-rzeznicki+- Garbage collection of dirty keys+([#2263](https://github.com/haskell/haskell-language-server/pull/2263)) by @pepeiborra+- Add lsp-mode links+([#2260](https://github.com/haskell/haskell-language-server/pull/2260)) by @jneira+- Add more features and demos in docs+([#2257](https://github.com/haskell/haskell-language-server/pull/2257)) by @jneira+- Add nix installation section+([#2256](https://github.com/haskell/haskell-language-server/pull/2256)) by @jneira+- Bump Fourmolu to 0.4+([#2254](https://github.com/haskell/haskell-language-server/pull/2254)) by @georgefst+- Remove custom version of operational+([#2249](https://github.com/haskell/haskell-language-server/pull/2249)) by @jneira+- Generate custom source tarball+([#2248](https://github.com/haskell/haskell-language-server/pull/2248)) by @jneira+- Enable the ghcide test plugin in HLS test suites+([#2243](https://github.com/haskell/haskell-language-server/pull/2243)) by @pepeiborra+- Partial sort of fuzzy filtering results+([#2240](https://github.com/haskell/haskell-language-server/pull/2240)) by @pepeiborra+- Fix build with fbghc+([#2234](https://github.com/haskell/haskell-language-server/pull/2234)) by @pepeiborra+- Tweaks to GHC support docs+([#2232](https://github.com/haskell/haskell-language-server/pull/2232)) by @michaelpj+- Add ghc deprecation policy to documentation+([#2231](https://github.com/haskell/haskell-language-server/pull/2231)) by @jneira+- Add ghcup compile option+([#2230](https://github.com/haskell/haskell-language-server/pull/2230)) by @jneira+- Parallel fuzzy filtering+([#2225](https://github.com/haskell/haskell-language-server/pull/2225)) by @pepeiborra+- Revert "Inline Text.Fuzzy to add INLINABLE pragmas"+([#2223](https://github.com/haskell/haskell-language-server/pull/2223)) by @pepeiborra+- feat(flake): expose hie-bios+([#2221](https://github.com/haskell/haskell-language-server/pull/2221)) by @teto+- flake: remove the 'follows' directive+([#2218](https://github.com/haskell/haskell-language-server/pull/2218)) by @teto+- Return completions lazily for massive savings+([#2217](https://github.com/haskell/haskell-language-server/pull/2217)) by @pepeiborra+- Inline Text.Fuzzy to add INLINABLE pragmas+([#2215](https://github.com/haskell/haskell-language-server/pull/2215)) by @pepeiborra+- Add chat on irc badge+([#2214](https://github.com/haskell/haskell-language-server/pull/2214)) by @jneira+- ghcide: Add flags to toggle building each executable+([#2212](https://github.com/haskell/haskell-language-server/pull/2212)) by @hololeap+- Add matrix haskell-tooling channel+([#2210](https://github.com/haskell/haskell-language-server/pull/2210)) by @jneira+- Relax upper bounds over ormolu and stylish-haskell+([#2207](https://github.com/haskell/haskell-language-server/pull/2207)) by @jneira+- Add missing config options in documentation+([#2203](https://github.com/haskell/haskell-language-server/pull/2203)) by @jneira+- Add gitlab CI+([#2200](https://github.com/haskell/haskell-language-server/pull/2200)) by @hasufell+- Apply workaround for 8.8.4 and windows to enable it in ci+([#2199](https://github.com/haskell/haskell-language-server/pull/2199)) by @jneira+- Drop ghc support for 8.6.4, 8.10.2, 8.10.3, 8.10.4+([#2197](https://github.com/haskell/haskell-language-server/pull/2197)) by @jneira+- Consider all root paths when suggesting module name change.+([#2195](https://github.com/haskell/haskell-language-server/pull/2195)) by @cdsmith+- enable completions of local imports+([#2190](https://github.com/haskell/haskell-language-server/pull/2190)) by @alexnaspo+- Drop ghc-api-compat from dependency closure+([#2128](https://github.com/haskell/haskell-language-server/pull/2128)) by @fendor+- Reimplement shake (continued)+([#2060](https://github.com/haskell/haskell-language-server/pull/2060)) by @pepeiborra+ ## 1.4.0  After a month of vacation a new hls release has arrived:@@ -27,6 +200,8 @@  ### Pull requests merged for 1.4.0 +- Prepare 1.4.0+([#2182](https://github.com/haskell/haskell-language-server/pull/2182)) by @jneira - Update flake to fix nix builds ([#2188](https://github.com/haskell/haskell-language-server/pull/2188)) by @jneira - Completions for project identifiers
README.md view
@@ -9,6 +9,7 @@ [![CircleCI][badge-circleci]][circleci] [![GitHub Testing Workflow](https://github.com/haskell/haskell-language-server/actions/workflows/test.yml/badge.svg)](https://github.com/haskell/haskell-language-server/actions/workflows/test.yml) [![GitHub Nix Workflow](https://github.com/haskell/haskell-language-server/actions/workflows/nix.yml/badge.svg)](https://github.com/haskell/haskell-language-server/actions/workflows/nix.yml)+[![ircchat][badge-ircchat]][ircchat] [![codetriage][badge-codetriage]][codetriage]  [logo]: ./docs/logos/logo-256.png@@ -21,6 +22,8 @@ [hackage]: https://hackage.haskell.org/package/haskell-language-server [badge-codetriage]: https://www.codetriage.com/haskell/haskell-language-server/badges/users.svg [codetriage]:https://www.codetriage.com/haskell/haskell-language-server+[badge-ircchat]:https://img.shields.io/badge/chat-on%20libera-brightgreen.svg+[ircchat]:https://web.libera.chat/?channels=#haskell-language-server [github-release]:https://github.com/haskell/haskell-language-server/releases/latest  The official Haskell language server (LSP) implementation. Consult the [project documentation](https://haskell-language-server.readthedocs.io/en/latest/) for more details.
haskell-language-server.cabal view
@@ -1,7 +1,7 @@ cabal-version:      2.4 category:           Development name:               haskell-language-server-version:            1.4.0.0+version:            1.5.0.0 synopsis:           LSP server for GHC description:   Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>@@ -14,16 +14,13 @@ license:            Apache-2.0 license-file:       LICENSE build-type:         Simple-tested-with:        GHC == 8.6.4 || == 8.6.5 || == 8.8.3 || == 8.8.4 || == 8.10.2 || == 8.10.3 || == 8.10.4 || == 8.10.5 || == 8.10.6+tested-with:        GHC == 8.6.5 || == 8.8.3 || == 8.8.4 || == 8.10.5 || == 8.10.6 || == 8.10.7 || == 9.0.1 extra-source-files:   README.md   ChangeLog.md   test/testdata/**/*.project   test/testdata/**/*.cabal   test/testdata/**/*.yaml-  -- this one is not matched by the previous glob-  test/testdata/hlint/ignore/.hlint.yaml-  test/testdata/**/*.h   test/testdata/**/*.hs  flag pedantic@@ -61,7 +58,7 @@     , cryptohash-sha1     , data-default     , ghc-    , ghcide                ^>=1.4+    , ghcide                ^>=1.4 || ^>=1.5     , gitrev     , lsp     , hie-bios@@ -86,18 +83,11 @@   default-extensions: DataKinds, TypeOperators  -- Plugin flags are designed for 'cabal install haskell-language-server':--- - Packaged plugins should be manual:False--- - Non packaged plugins and bulk flags should be manual:True -- - Bulk flags should be default:False -- - Individual flags should be default:True -flag all-plugins-  description: Enable all non formatter plugins-  default:     False-  manual:      True--flag all-formatters-  description: Enable all fomatters+flag ignore-plugins-ghc-bounds+  description: Force the inclusion of plugins even if they are not buildable by default with a specific ghc version   default:     False   manual:      True @@ -199,94 +189,94 @@                  Ide.Plugin.Example2  common class-  if flag(class) || flag(all-plugins)+  if flag(class) && (impl(ghc < 9.0.1) || flag(ignore-plugins-ghc-bounds))     build-depends: hls-class-plugin ^>=1.0.0.1     cpp-options: -Dclass  common callHierarchy-  if flag(callHierarchy) || flag(all-plugins)+  if flag(callHierarchy) && (impl(ghc < 9.2.1) || flag(ignore-plugins-ghc-bounds))     build-depends: hls-call-hierarchy-plugin ^>=1.0.0.0     cpp-options: -DcallHierarchy  common haddockComments-  if flag(haddockComments) || flag(all-plugins)+  if flag(haddockComments)     build-depends: hls-haddock-comments-plugin ^>=1.0.0.1     cpp-options: -DhaddockComments  common eval-  if flag(eval) || flag(all-plugins)-    build-depends: hls-eval-plugin ^>=1.1.0.0+  if flag(eval)+    build-depends: hls-eval-plugin ^>=1.2.0.0     cpp-options: -Deval  common importLens-  if flag(importLens) || flag(all-plugins)+  if flag(importLens)     build-depends: hls-explicit-imports-plugin ^>=1.0.0.1     cpp-options: -DimportLens  common refineImports-  if flag(refineImports) || flag(all-plugins)+  if flag(refineImports) && (impl(ghc < 9.2.1) || flag(ignore-plugins-ghc-bounds))     build-depends: hls-refine-imports-plugin ^>=1.0.0.0     cpp-options: -DrefineImports  common rename-  if flag(rename) || flag(all-plugins)+  if flag(rename)     build-depends: hls-rename-plugin ^>= 1.0.0.0     cpp-options: -Drename  common retrie-  if flag(retrie) || flag(all-plugins)+  if flag(retrie) && (impl(ghc < 9.2.1) || flag(ignore-plugins-ghc-bounds))     build-depends: hls-retrie-plugin ^>=1.0.0.1     cpp-options: -Dretrie  common tactic-  if flag(tactic) || flag(all-plugins)-    build-depends: hls-tactics-plugin >=1.2.0.0 && <1.5+  if flag(tactic) && (impl(ghc < 9.0.1) || flag(ignore-plugins-ghc-bounds))+    build-depends: hls-tactics-plugin >=1.2.0.0 && <1.6     cpp-options: -Dtactic  common hlint-  if flag(hlint) || flag(all-plugins)+  if flag(hlint)     build-depends: hls-hlint-plugin ^>=1.0.0.2     cpp-options: -Dhlint  common moduleName-  if flag(moduleName) || flag(all-plugins)+  if flag(moduleName)     build-depends: hls-module-name-plugin ^>=1.0.0.0     cpp-options: -DmoduleName  common pragmas-  if flag(pragmas) || flag(all-plugins)+  if flag(pragmas)     build-depends: hls-pragmas-plugin ^>=1.0.0.0     cpp-options: -Dpragmas  common splice-  if flag(splice) || flag(all-plugins)+  if flag(splice) && (impl(ghc < 9.2.1) || flag(ignore-plugins-ghc-bounds))     build-depends: hls-splice-plugin ^>=1.0.0.1     cpp-options: -Dsplice  -- formatters  common floskell-  if flag(floskell) || flag(all-formatters)+  if flag(floskell) && (impl(ghc < 9.0.1) || flag(ignore-plugins-ghc-bounds))     build-depends: hls-floskell-plugin ^>=1.0.0.0     cpp-options: -Dfloskell  common fourmolu-  if flag(fourmolu) || flag(all-formatters)+  if flag(fourmolu) && (impl(ghc < 9.2.1) || flag(ignore-plugins-ghc-bounds))     build-depends: hls-fourmolu-plugin ^>=1.0.0.0     cpp-options: -Dfourmolu  common ormolu-  if flag(ormolu) || flag(all-formatters)+  if flag(ormolu)     build-depends: hls-ormolu-plugin ^>=1.0.0.0     cpp-options: -Dormolu  common stylishHaskell-  if flag(stylishHaskell) || flag(all-formatters)+  if flag(stylishHaskell) && (impl(ghc < 9.0.1) || flag(ignore-plugins-ghc-bounds))     build-depends: hls-stylish-haskell-plugin ^>=1.0.0.0     cpp-options: -DstylishHaskell  common brittany-  if (flag(brittany) || flag(all-formatters))+  if flag(brittany) && (impl(ghc < 9.0.1) || flag(ignore-plugins-ghc-bounds))     build-depends: hls-brittany-plugin ^>=1.0.0.1     cpp-options: -Dbrittany @@ -360,22 +350,6 @@     , transformers     , unordered-containers -  if impl(ghc < 8.10.5)-    build-depends:-      ghc-api-compat ==8.6-  elif impl(ghc == 8.10.5)-    build-depends:-      ghc-api-compat ==8.10.5-  elif impl(ghc == 8.10.6)-    build-depends:-      ghc-api-compat ==8.10.6-  elif impl(ghc == 8.10.7)-    build-depends:-      ghc-api-compat ==8.10.7-  elif impl(ghc == 9.0.1)-    build-depends:-      ghc-api-compat ==9.0.1-   default-language: Haskell2010   default-extensions: DataKinds, TypeOperators @@ -462,42 +436,16 @@   if flag(pedantic)     ghc-options: -Werror -Wredundant-constraints -  if flag(callHierarchy) || flag(all-plugins)-    cpp-options: -DcallHierarchy-  if flag(class) || flag(all-plugins)-    cpp-options: -Dclass-  if flag(haddockComments) || flag(all-plugins)-    cpp-options: -DhaddockComments-  if flag(eval) || flag(all-plugins)+-- Duplicating inclusion plugin conditions until tests are moved to their own packages+  if flag(eval)     cpp-options: -Deval-  if flag(importLens) || flag(all-plugins)-    cpp-options: -DimportLens-  if flag(rename) || flag(all-plugins)-    cpp-options: -Drename-  if flag(retrie) || flag(all-plugins)-    cpp-options: -Dretrie-  if flag(tactic) || flag(all-plugins)-    cpp-options: -Dtactic-  if flag(hlint) || flag(all-plugins)-    cpp-options: -Dhlint-  if flag(moduleName) || flag(all-plugins)-    cpp-options: -DmoduleName-  if flag(pragmas) || flag(all-plugins)-    cpp-options: -Dpragmas-  if flag(splice) || flag(all-plugins)-    cpp-options: -Dsplice- -- formatters-  if flag(floskell) || flag(all-formatters)+  if flag(floskell) && (impl(ghc < 9.0.1) || flag(ignore-plugins-ghc-bounds))     cpp-options: -Dfloskell-  if flag(fourmolu) || flag(all-formatters)+  if flag(fourmolu) && (impl(ghc < 9.2.1) || flag(ignore-plugins-ghc-bounds))     cpp-options: -Dfourmolu-  if flag(ormolu) || flag(all-formatters)+  if flag(ormolu)     cpp-options: -Dormolu-  if flag(stylishHaskell) || flag(all-formatters)-    cpp-options: -DstylishHaskell-  if (flag(brittany) || flag(all-formatters))-    cpp-options: -Dbrittany  test-suite wrapper-test   type:               exitcode-stdio-1.0
plugins/default/src/Ide/Plugin/Example.hs view
@@ -18,7 +18,6 @@ import           Control.Monad.IO.Class import           Control.Monad.Trans.Maybe import           Data.Aeson-import           Data.Binary import           Data.Functor import qualified Data.HashMap.Strict        as Map import           Data.Hashable@@ -71,7 +70,6 @@     deriving (Eq, Show, Typeable, Generic) instance Hashable Example instance NFData   Example-instance Binary   Example  type instance RuleResult Example = () 
plugins/default/src/Ide/Plugin/Example2.hs view
@@ -18,7 +18,6 @@ import           Control.Monad.IO.Class import           Control.Monad.Trans.Maybe import           Data.Aeson-import           Data.Binary import           Data.Functor import qualified Data.HashMap.Strict        as Map import           Data.Hashable@@ -63,7 +62,6 @@     deriving (Eq, Show, Typeable, Generic) instance Hashable Example2 instance NFData   Example2-instance Binary   Example2  type instance RuleResult Example2 = () 
src/Ide/Main.hs view
@@ -16,6 +16,7 @@ import           Data.List                     (sort) import qualified Data.Text                     as T import           Development.IDE.Core.Rules+import           Development.IDE.Core.Tracing  (withTelemetryLogger) import           Development.IDE.Graph         (ShakeOptions (shakeThreads)) import           Development.IDE.Main          (isLSP) import qualified Development.IDE.Main          as Main@@ -90,7 +91,7 @@ -- ---------------------------------------------------------------------  runLspMode :: GhcideArguments -> IdePlugins IdeState -> IO ()-runLspMode ghcideArgs@GhcideArguments{..} idePlugins = do+runLspMode ghcideArgs@GhcideArguments{..} idePlugins = withTelemetryLogger $ \telemetryLogger -> do     whenJust argsCwd IO.setCurrentDirectory     dir <- IO.getCurrentDirectory     LSP.setupLogger argsLogFile ["hls", "hie-bios"]@@ -105,7 +106,8 @@     Main.defaultMain def       { Main.argCommand = argsCommand       , Main.argsHlsPlugins = idePlugins-      , Main.argsLogger = pure hlsLogger+      , Main.argsLogger = pure hlsLogger <> pure telemetryLogger+      , Main.argsThreads = if argsThreads == 0 then Nothing else Just $ fromIntegral argsThreads       , Main.argsIdeOptions = \_config sessionLoader ->         let defOptions = Ghcide.defaultIdeOptions sessionLoader         in defOptions
test/functional/Completion.hs view
@@ -253,8 +253,7 @@          let config = object ["haskell" .= object ["plugin" .= object ["ghcide-completions" .= object ["config" .= object ["snippetsOn" .= False]]]]] -        sendNotification SWorkspaceDidChangeConfiguration-                        (DidChangeConfigurationParams config)+        sendConfigurationChanged config          checkNoSnippets doc 
test/functional/Config.hs view
@@ -5,10 +5,7 @@ import           Control.Lens            hiding (List, (.=)) import           Control.Monad import           Data.Aeson-import qualified Data.Map                as Map import qualified Data.Text               as T-import           Ide.Plugin.Config-import qualified Ide.Plugin.Config       as Plugin import           Language.LSP.Test       as Test import qualified Language.LSP.Types.Lens as L import           System.FilePath         ((</>))@@ -19,94 +16,16 @@  tests :: TestTree tests = testGroup "plugin config" [-      -- Note: because the flag is treated generically in the plugin handler, we-      -- do not have to test each individual plugin-      hlintTests-    , configTests+      -- Note: there are more comprehensive tests over config in hls-hlint-plugin+      -- TODO: Add generic tests over some example plugin+      configTests     ] -hlintTests :: TestTree-hlintTests = testGroup "hlint plugin enables" [--      testCase "changing hlintOn configuration enables or disables hlint diagnostics" $ runHlintSession "" $ do-        let config = def { hlintOn = True }-        sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))--        doc <- openDoc "ApplyRefact2.hs" "haskell"-        testHlintDiagnostics doc--        let config' = def { hlintOn = False }-        sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config'))--        diags' <- waitForDiagnosticsFrom doc--        liftIO $ noHlintDiagnostics diags'--    , testCase "changing hlint plugin configuration enables or disables hlint diagnostics" $ runHlintSession "" $ do-        let config = def { hlintOn = True }-        sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))--        doc <- openDoc "ApplyRefact2.hs" "haskell"-        testHlintDiagnostics doc--        let config' = pluginGlobalOn config "hlint" False-        sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config'))--        diags' <- waitForDiagnosticsFrom doc--        liftIO $ noHlintDiagnostics diags'--    , testCase "adding hlint flags to plugin configuration removes hlint diagnostics" $ runHlintSession "" $ do-        let config = def { hlintOn = True }-        sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))--        doc <- openDoc "ApplyRefact2.hs" "haskell"-        testHlintDiagnostics doc--        let config' = hlintConfigWithFlags ["--ignore=Redundant id", "--hint=test-hlint-config.yaml"]-        sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config'))--        diags' <- waitForDiagnosticsFrom doc--        liftIO $ noHlintDiagnostics diags'--    , testCase "adding hlint flags to plugin configuration adds hlint diagnostics" $ runHlintSession "" $ do-        let config = def { hlintOn = True }-        sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))--        doc <- openDoc "ApplyRefact7.hs" "haskell"--        expectNoMoreDiagnostics 3 doc "hlint"--        let config' = hlintConfigWithFlags ["--with-group=generalise"]-        sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config'))--        diags' <- waitForDiagnosticsFromSource doc "hlint"-        d <- liftIO $ inspectDiagnostic diags' ["Use <>"]--        liftIO $ do-            length diags' @?= 1-            d ^. L.range @?= Range (Position 1 10) (Position 1 21)-            d ^. L.severity @?= Just DsInfo-    ]-    where-        runHlintSession :: FilePath -> Session a -> IO a-        runHlintSession subdir  =-            failIfSessionTimeout . runSession hlsCommand fullCaps ("test/testdata/hlint" </> subdir)--        noHlintDiagnostics :: [Diagnostic] -> Assertion-        noHlintDiagnostics diags =-            Just "hlint" `notElem` map (^. L.source) diags @? "There are no hlint diagnostics"--        testHlintDiagnostics doc = do-            diags <- waitForDiagnosticsFromSource doc "hlint"-            liftIO $ length diags > 0 @? "There are hlint diagnostics"- configTests :: TestTree configTests = testGroup "config parsing" [       testCase "empty object as user configuration should not send error logMessage" $ runConfigSession "" $ do         let config = object []-        sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))+        sendConfigurationChanged (toJSON config)          -- Send custom request so server returns a response to prevent blocking         void $ sendNotification (SCustomMethod "non-existent-method") Null@@ -121,20 +40,3 @@         runConfigSession :: FilePath -> Session a -> IO a         runConfigSession subdir  =             failIfSessionTimeout . runSession hlsCommand fullCaps ("test/testdata" </> subdir)--pluginGlobalOn :: Config -> T.Text -> Bool -> Config-pluginGlobalOn config pid state = config'-  where-      pluginConfig = def { plcGlobalOn = state }-      config' = def { plugins = Map.insert pid pluginConfig (plugins config) }--hlintConfigWithFlags :: [T.Text] -> Config-hlintConfigWithFlags flags =-  def-    { hlintOn = True-    , Plugin.plugins = Map.fromList [("hlint",-        def { Plugin.plcConfig = unObject $ object ["flags" .= flags] }-    )] }-  where-    unObject (Object obj) = obj-    unObject _            = undefined
test/functional/Diagnostic.hs view
@@ -21,21 +21,9 @@  basicTests :: TestTree basicTests = testGroup "Diagnostics work" [-    testCase "hlint produces diagnostics" $-        runSession hlsCommand fullCaps "test/testdata/hlint" $ do-            doc <- openDoc "ApplyRefact2.hs" "haskell"-            diags <- waitForDiagnosticsFromSource doc "hlint"-            reduceDiag <- liftIO $ inspectDiagnostic diags ["Eta reduce"]-            redundantID <- liftIO $ inspectDiagnostic diags ["Redundant id"]-            liftIO $ do-                length diags @?= 2-                reduceDiag ^. LSP.range @?= Range (Position 1 0) (Position 1 12)-                reduceDiag ^. LSP.severity @?= Just DsInfo-                redundantID ^. LSP.severity @?= Just DsInfo--    , testCase "example plugin produces diagnostics" $-        runSession hlsCommandExamplePlugin fullCaps "test/testdata/hlint" $ do-            doc <- openDoc "ApplyRefact2.hs" "haskell"+    testCase "example plugin produces diagnostics" $+        runSession hlsCommandExamplePlugin fullCaps "test/testdata/diagnostics" $ do+            doc <- openDoc "Foo.hs" "haskell"             diags <- waitForDiagnosticsFromSource doc "example2"             reduceDiag <- liftIO $ inspectDiagnostic diags ["example2 diagnostic, hello world"]             liftIO $ do@@ -58,7 +46,7 @@     ignoreTestBecause "diagnosticsOnChange parameter is not supported right now" $ testCase "Respects diagnosticsOnChange setting" $         runSession hlsCommandExamplePlugin codeActionSupportCaps "test/testdata" $ do             let config = Data.Default.def { diagnosticsOnChange = False } :: Config-            sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))+            sendConfigurationChanged (toJSON config)             doc <- openDoc "Hover.hs" "haskell"             diags <- waitForDiagnosticsFrom doc 
test/functional/Format.hs view
@@ -56,15 +56,15 @@          doc <- openDoc "Format.hs" "haskell" -        sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfig "ormolu"))+        sendConfigurationChanged (formatLspConfig "ormolu")         formatDoc doc (FormattingOptions 2 True Nothing Nothing Nothing)         documentContents doc >>= liftIO . (@?= formattedOrmolu) -        sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfig "floskell"))+        sendConfigurationChanged (formatLspConfig "floskell")         formatDoc doc (FormattingOptions 2 True Nothing Nothing Nothing)         documentContents doc >>= liftIO . (@?= formattedFloskell) -        sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfig "ormolu"))+        sendConfigurationChanged (formatLspConfig "ormolu")         formatDoc doc (FormattingOptions 2 True Nothing Nothing Nothing)         documentContents doc >>= liftIO . (@?= formattedOrmoluPostFloskell)     , requiresOrmoluPlugin . requiresFloskellPlugin $ testCase "supports both new and old configuration sections" $ runSession hlsCommand fullCaps "test/testdata/format" $ do@@ -73,11 +73,11 @@         doc <- openDoc "Format.hs" "haskell" -       sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfigOld "ormolu"))+       sendConfigurationChanged (formatLspConfigOld "ormolu")        formatDoc doc (FormattingOptions 2 True Nothing Nothing Nothing)        documentContents doc >>= liftIO . (@?= formattedOrmolu) -       sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfigOld "floskell"))+       sendConfigurationChanged (formatLspConfigOld "floskell")        formatDoc doc (FormattingOptions 2 True Nothing Nothing Nothing)        documentContents doc >>= liftIO . (@?= formattedFloskell)     ]
test/functional/FunctionalCodeAction.hs view
@@ -14,20 +14,17 @@ import qualified Data.Text                       as T import           Ide.Plugin.Config import           Language.LSP.Test               as Test-import qualified Language.LSP.Types.Capabilities as C import qualified Language.LSP.Types.Lens         as L import           Test.Hls import           Test.Hspec.Expectations -import           System.FilePath                 ((</>)) import           Test.Hls.Command  {-# ANN module ("HLint: ignore Reduce duplication"::String) #-}  tests :: TestTree tests = testGroup "code actions" [-      hlintTests-    , importTests+      importTests     , packageTests     , redundantImportTests     , renameTests@@ -36,194 +33,6 @@     , unusedTermTests     ] --hlintTests :: TestTree-hlintTests = testGroup "hlint suggestions" [-    testCase "provides 3.8 code actions including apply all" $ runHlintSession "" $ do-        doc <- openDoc "ApplyRefact2.hs" "haskell"-        diags@(reduceDiag:_) <- waitForDiagnosticsFromSource doc "hlint"--        liftIO $ do-            length diags @?= 2 -- "Eta Reduce" and "Redundant Id"-            reduceDiag ^. L.range @?= Range (Position 1 0) (Position 1 12)-            reduceDiag ^. L.severity @?= Just DsInfo-            reduceDiag ^. L.code @?= Just (InR "refact:Eta reduce")-            reduceDiag ^. L.source @?= Just "hlint"--        cas <- map fromAction <$> getAllCodeActions doc--        let applyAll = find (\ca -> "Apply all hints" `T.isSuffixOf` (ca ^. L.title)) cas-        let redId = find (\ca -> "Redundant id" `T.isSuffixOf` (ca ^. L.title)) cas-        let redEta = find (\ca -> "Eta reduce" `T.isSuffixOf` (ca ^. L.title)) cas--        liftIO $ isJust applyAll @? "There is 'Apply all hints' code action"-        liftIO $ isJust redId @? "There is 'Redundant id' code action"-        liftIO $ isJust redEta @? "There is 'Eta reduce' code action"--        executeCodeAction (fromJust redId)--        contents <- skipManyTill anyMessage $ getDocumentEdit doc-        liftIO $ contents @?= "main = undefined\nfoo x = x\n"--    , testCase "falls back to pre 3.8 code actions" $ runSession hlsCommand noLiteralCaps "test/testdata/hlint" $ do-        doc <- openDoc "ApplyRefact2.hs" "haskell"--        _ <- waitForDiagnosticsFromSource doc "hlint"--        cars <- getAllCodeActions doc-        etaReduce <- liftIO $ inspectCommand cars ["Eta reduce"]--        executeCommand etaReduce--        contents <- skipManyTill anyMessage $ getDocumentEdit doc-        liftIO $ contents @?= "main = undefined\nfoo = id\n"--    , testCase "changing configuration enables or disables hlint diagnostics" $ runHlintSession "" $ do-        let config = def { hlintOn = True }-        sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))--        doc <- openDoc "ApplyRefact2.hs" "haskell"-        testHlintDiagnostics doc--        let config' = def { hlintOn = False }-        sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config'))--        diags' <- waitForDiagnosticsFrom doc--        liftIO $ noHlintDiagnostics diags'--    , testCase "changing document contents updates hlint diagnostics" $ runHlintSession "" $ do-        doc <- openDoc "ApplyRefact2.hs" "haskell"-        testHlintDiagnostics doc--        let change = TextDocumentContentChangeEvent-                        (Just (Range (Position 1 8) (Position 1 12)))-                         Nothing "x"-        changeDoc doc [change]-        expectNoMoreDiagnostics 3 doc "hlint"--        let change' = TextDocumentContentChangeEvent-                        (Just (Range (Position 1 8) (Position 1 12)))-                         Nothing "id x"-        changeDoc doc [change']-        testHlintDiagnostics doc--    , knownBrokenForGhcVersions [GHC88, GHC86] "hlint doesn't take in account cpp flag as ghc -D argument" $-      testCase "hlint diagnostics works with CPP via ghc -XCPP argument (#554)" $ runHlintSession "cpp" $ do-        doc <- openDoc "ApplyRefact3.hs" "haskell"-        testHlintDiagnostics doc--    , knownBrokenForGhcVersions [GHC88, GHC86] "hlint doesn't take in account cpp flag as ghc -D argument" $-      testCase "hlint diagnostics works with CPP via language pragma (#554)" $ runHlintSession "" $ do-        doc <- openDoc "ApplyRefact3.hs" "haskell"-        testHlintDiagnostics doc--    , testCase "hlint diagnostics works with CPP via -XCPP argument and flag via #include header (#554)" $ runHlintSession "cpp" $ do-        doc <- openDoc "ApplyRefact2.hs" "haskell"-        testHlintDiagnostics doc--    , testCase "apply-refact works with -XLambdaCase argument (#590)" $ runHlintSession "lambdacase" $ do-        testRefactor "ApplyRefact1.hs" "Redundant bracket"-            expectedLambdaCase--    , testCase "apply-refact works with -XTypeApplications argument (#1242)" $ runHlintSession "typeapps" $ do-        testRefactor "ApplyRefact1.hs" "Redundant bracket"-            expectedTypeApp--    , testCase "apply hints works with LambdaCase via language pragma" $ runHlintSession "" $ do-        testRefactor "ApplyRefact1.hs" "Redundant bracket"-            ("{-# LANGUAGE LambdaCase #-}" : expectedLambdaCase)--    , expectFailBecause "apply-refact doesn't work with cpp" $-      testCase "apply hints works with CPP via -XCPP argument" $ runHlintSession "cpp" $ do-        testRefactor "ApplyRefact3.hs" "Redundant bracket"-            expectedCPP--    , expectFailBecause "apply-refact doesn't work with cpp" $-      testCase "apply hints works with CPP via language pragma" $ runHlintSession "" $ do-        testRefactor "ApplyRefact3.hs" "Redundant bracket"-            ("{-# LANGUAGE CPP #-}" : expectedCPP)--    , testCase "hlint diagnostics ignore hints honouring .hlint.yaml" $ runHlintSession "ignore" $ do-        doc <- openDoc "ApplyRefact.hs" "haskell"-        expectNoMoreDiagnostics 3 doc "hlint"--    , testCase "hlint diagnostics ignore hints honouring ANN annotations" $ runHlintSession "" $ do-        doc <- openDoc "ApplyRefact4.hs" "haskell"-        expectNoMoreDiagnostics 3 doc "hlint"--    , knownBrokenForGhcVersions [GHC810, GHC90] "hlint plugin doesn't honour HLINT annotations (#838)" $-      testCase "hlint diagnostics ignore hints honouring HLINT annotations" $ runHlintSession "" $ do-        doc <- openDoc "ApplyRefact5.hs" "haskell"-        expectNoMoreDiagnostics 3 doc "hlint"--    , testCase "apply-refact preserve regular comments" $ runHlintSession "" $ do-        testRefactor "ApplyRefact6.hs" "Redundant bracket" expectedComments--    , testCase "applyAll is shown only when there is at least one diagnostic in range" $  runHlintSession "" $ do-        doc <- openDoc "ApplyRefact8.hs" "haskell"-        _ <- waitForDiagnosticsFromSource doc "hlint"--        firstLine <- map fromAction <$> getCodeActions doc (mkRange 0 0 0 0)-        secondLine <- map fromAction <$> getCodeActions doc (mkRange 1 0 1 0)-        thirdLine <- map fromAction <$> getCodeActions doc (mkRange 2 0 2 0)-        multiLine <- map fromAction <$> getCodeActions doc (mkRange 0 0 2 0)--        let hasApplyAll = isJust . find (\ca -> "Apply all hints" `T.isSuffixOf` (ca ^. L.title))--        liftIO $ hasApplyAll firstLine @? "Missing apply all code action"-        liftIO $ hasApplyAll secondLine @? "Missing apply all code action"-        liftIO $ not (hasApplyAll thirdLine) @? "Unexpected apply all code action"-        liftIO $ hasApplyAll multiLine @? "Missing apply all code action"-    ]-    where-        runHlintSession :: FilePath -> Session a -> IO a-        runHlintSession subdir  =-            failIfSessionTimeout . runSession hlsCommand fullCaps ("test/testdata/hlint" </> subdir)--        noHlintDiagnostics :: [Diagnostic] -> Assertion-        noHlintDiagnostics diags =-            Just "hlint" `notElem` map (^. L.source) diags @? "There are no hlint diagnostics"--        testHlintDiagnostics doc = do-            diags <- waitForDiagnosticsFromSource doc "hlint"-            liftIO $ length diags > 0 @? "There are hlint diagnostics"--        testRefactor file caTitle expected = do-            doc <- openDoc file "haskell"-            testHlintDiagnostics doc--            cas <- map fromAction <$> getAllCodeActions doc-            let ca = find (\ca -> caTitle `T.isSuffixOf` (ca ^. L.title)) cas-            liftIO $ isJust ca @? ("There is '" ++ T.unpack caTitle ++"' code action")--            executeCodeAction (fromJust ca)--            contents <- skipManyTill anyMessage $ getDocumentEdit doc-            liftIO $ contents @?= T.unlines expected--        expectedLambdaCase = [ "module ApplyRefact1 where", ""-                             , "f = \\case \"true\" -> True"-                             , "          _ -> False"-                             ]-        expectedCPP =        [ "module ApplyRefact3 where", ""-                             , "#ifdef FLAG"-                             , "f = 1"-                             , "#else"-                             , "g = 2"-                             , "#endif", ""-                             ]-        expectedComments =   [ "-- comment before header"-                             , "module ApplyRefact6 where", ""-                             , "{-# standalone annotation #-}", ""-                             , "-- standalone comment", ""-                             , "-- | haddock comment"-                             , "f = {- inline comment -}{- inline comment inside refactored code -} 1 -- ending comment", ""-                             , "-- final comment"-                             ]-        expectedTypeApp =    [ "module ApplyRefact1 where", ""-                             , "a = id @Int 1"-                             ] renameTests :: TestTree renameTests = testGroup "rename suggestions" [     testCase "works" $ runSession hlsCommand noLiteralCaps "test/testdata" $ do@@ -269,7 +78,7 @@         doc <- openDoc "CodeActionImport.hs" "haskell"         -- No Formatting:         let config = def { formattingProvider = "none" }-        sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))+        sendConfigurationChanged (toJSON config)          (diag:_) <- waitForDiagnosticsFrom doc         liftIO $ diag ^. L.message @?= "Variable not in scope: when :: Bool -> IO () -> IO ()"@@ -553,17 +362,6 @@  disableWingman :: Session () disableWingman =-  sendConfigurationChanged $ def+  sendConfigurationChanged $ toJSON $ def     { plugins = M.fromList [ ("tactics", def { plcGlobalOn = False }) ]     }---sendConfigurationChanged :: Config -> Session ()-sendConfigurationChanged config =-  sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))--noLiteralCaps :: C.ClientCapabilities-noLiteralCaps = def { C._textDocument = Just textDocumentCaps }-  where-    textDocumentCaps = def { C._codeAction = Just codeActionCaps }-    codeActionCaps = CodeActionClientCapabilities (Just True) Nothing Nothing Nothing Nothing Nothing Nothing
test/functional/FunctionalLiquid.hs view
@@ -19,7 +19,7 @@             doc <- openDoc "liquid/Evens.hs" "haskell"              let config = def { liquidOn  = True, hlintOn = False }-            sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))+            sendConfigurationChanged (toJSON config)              diags <- waitForDiagnosticsFromSource doc "liquid"             d <- liftIO $ inspectDiagnostic diags ["Liquid Type Mismatch"]
test/functional/Main.hs view
@@ -28,14 +28,14 @@             , Deferred.tests             , Definition.tests             , Diagnostic.tests-            , Format.tests+            , ignoreInEnv [HostOS Windows, GhcVer GHC90] "Tests gets stuck in ci" $ Format.tests             , FunctionalBadProject.tests             , FunctionalCodeAction.tests             , FunctionalLiquid.tests             , HieBios.tests             , Highlight.tests-            , Progress.tests+            , ignoreInEnv [HostOS Windows, GhcVer GHC90] "Tests gets stuck in ci" $ Progress.tests             , Reference.tests-            , Symbol.tests+            , ignoreInEnv [HostOS Windows, GhcVer GHC90] "Tests gets stuck in ci" $ Symbol.tests             , TypeDefinition.tests             ]
test/functional/Progress.hs view
@@ -27,9 +27,9 @@         "window/workDoneProgress"         [ testCase "sends indefinite progress notifications" $             runSession hlsCommand progressCaps "test/testdata" $ do-                let path = "hlint" </> "ApplyRefact2.hs"+                let path = "diagnostics" </> "Foo.hs"                 _ <- openDoc path "haskell"-                expectProgressReports [pack ("Setting up hlint (for " ++ path ++ ")"), "Processing", "Indexing"]+                expectProgressReports [pack ("Setting up testdata (for " ++ path ++ ")"), "Processing", "Indexing"]         , requiresEvalPlugin $ testCase "eval plugin sends progress reports" $             runSession hlsCommand progressCaps "plugins/hls-eval-plugin/test/testdata" $ do                 doc <- openDoc "T1.hs" "haskell"@@ -40,14 +40,14 @@                 expectProgressReports ["Evaluating"]         , requiresOrmoluPlugin $ testCase "ormolu plugin sends progress notifications" $ do             runSession hlsCommand progressCaps "test/testdata/format" $ do-                sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfig "ormolu"))+                sendConfigurationChanged (formatLspConfig "ormolu")                 doc <- openDoc "Format.hs" "haskell"                 expectProgressReports ["Setting up testdata (for Format.hs)", "Processing", "Indexing"]                 _ <- sendRequest STextDocumentFormatting $ DocumentFormattingParams Nothing doc (FormattingOptions 2 True Nothing Nothing Nothing)                 expectProgressReports ["Formatting Format.hs"]         , requiresFourmoluPlugin $ testCase "fourmolu plugin sends progress notifications" $ do             runSession hlsCommand progressCaps "test/testdata/format" $ do-                sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfig "fourmolu"))+                sendConfigurationChanged (formatLspConfig "fourmolu")                 doc <- openDoc "Format.hs" "haskell"                 expectProgressReports ["Setting up testdata (for Format.hs)", "Processing", "Indexing"]                 _ <- sendRequest STextDocumentFormatting $ DocumentFormattingParams Nothing doc (FormattingOptions 2 True Nothing Nothing Nothing)@@ -57,7 +57,7 @@                 runSession hlsCommand progressCaps "test/testdata" $ do                     doc <- openDoc "liquid/Evens.hs" "haskell"                     let config = def{liquidOn = True, hlintOn = False}-                    sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))+                    sendConfigurationChanged (toJSON config)                     sendNotification STextDocumentDidSave (DidSaveTextDocumentParams doc Nothing)                     expectProgressReports ["Running Liquid Haskell on Evens.hs"]         ]
− test/testdata/cabal-helper/implicit-exe/Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
− test/testdata/cabal-helper/implicit-exe/cabal.project
@@ -1,1 +0,0 @@-packages: ./
− test/testdata/cabal-helper/implicit-exe/implicit-exe.cabal
@@ -1,17 +0,0 @@-cabal-version:       >=1.10-name:                implicit-exe-version:             0.1.0.0-license-file:        LICENSE-build-type:          Simple--library-  exposed-modules:     Lib-  hs-source-dirs:      src-  build-depends:       base-  default-language:    Haskell2010---executable implicit-exe-  main-is:             src/Exe.hs-  build-depends:       base, implicit-exe-  default-language:    Haskell2010
− test/testdata/cabal-helper/implicit-exe/src/Exe.hs
@@ -1,4 +0,0 @@--import Lib (someFunc)--main = someFunc
− test/testdata/cabal-helper/implicit-exe/src/Lib.hs
@@ -1,4 +0,0 @@-module Lib (someFunc) where--someFunc :: IO ()-someFunc = putStrLn "someFunc"
− test/testdata/cabal-helper/mono-repo/A/A.cabal
@@ -1,15 +0,0 @@-cabal-version:       >=1.10-name:                A-version:             0.1.0.0-build-type:          Simple--library-  exposed-modules:     MyLib-  build-depends:       base-  default-language:    Haskell2010--executable A-  main-is:             Main.hs-  other-modules:       MyLib-  build-depends:       base, A-  default-language:    Haskell2010
− test/testdata/cabal-helper/mono-repo/A/Main.hs
@@ -1,8 +0,0 @@-module Main where--import qualified MyLib (someFunc)--main :: IO ()-main = do-  putStrLn "Hello, Haskell!"-  MyLib.someFunc
− test/testdata/cabal-helper/mono-repo/A/MyLib.hs
@@ -1,4 +0,0 @@-module MyLib (someFunc) where--someFunc :: IO ()-someFunc = putStrLn "someFunc"
− test/testdata/cabal-helper/mono-repo/A/Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
− test/testdata/cabal-helper/mono-repo/B/B.cabal
@@ -1,15 +0,0 @@-cabal-version:       >=1.10-name:                B-version:             0.1.0.0-build-type:          Simple--library-  exposed-modules:     MyLib-  build-depends:       base-  default-language:    Haskell2010--executable B-  main-is:             Main.hs-  other-modules:       MyLib-  build-depends:       base, B-  default-language:    Haskell2010
− test/testdata/cabal-helper/mono-repo/B/Main.hs
@@ -1,8 +0,0 @@-module Main where--import qualified MyLib (someFunc)--main :: IO ()-main = do-  putStrLn "Hello, Haskell!"-  MyLib.someFunc
− test/testdata/cabal-helper/mono-repo/B/MyLib.hs
@@ -1,4 +0,0 @@-module MyLib (someFunc) where--someFunc :: IO ()-someFunc = putStrLn "someFunc"
− test/testdata/cabal-helper/mono-repo/B/Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
− test/testdata/cabal-helper/mono-repo/C/C.cabal
@@ -1,9 +0,0 @@-cabal-version:       >=1.10-name:                C-version:             0.1.0.0-build-type:          Simple--library-  exposed-modules:     MyLib-  build-depends:       base-  default-language:    Haskell2010
− test/testdata/cabal-helper/mono-repo/C/MyLib.hs
@@ -1,4 +0,0 @@-module MyLib (someFunc) where--someFunc :: IO ()-someFunc = putStrLn "someFunc"
− test/testdata/cabal-helper/mono-repo/C/Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
− test/testdata/cabal-helper/mono-repo/cabal.project
@@ -1,4 +0,0 @@-packages:-  ./A/-  ./B/-  ./C/
− test/testdata/cabal-helper/multi-source-dirs/Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
− test/testdata/cabal-helper/multi-source-dirs/multi-source-dirs.cabal
@@ -1,11 +0,0 @@-cabal-version:       >=1.10-name:                multi-source-dirs-version:             0.1.0.0-license-file:        LICENSE-build-type:          Simple--library-  exposed-modules:     Lib, BetterLib-  hs-source-dirs:      src, src/input-  build-depends:       base-  default-language:    Haskell2010
− test/testdata/cabal-helper/multi-source-dirs/src/BetterLib.hs
@@ -1,5 +0,0 @@-module BetterLib where---foo = 3-bar = "String"
− test/testdata/cabal-helper/multi-source-dirs/src/input/Lib.hs
@@ -1,6 +0,0 @@-module Lib where--foobar = 15--fizbuzz :: Int -> String-fizbuzz n = "Fizz"
− test/testdata/cabal-helper/simple-cabal/MyLib.hs
@@ -1,4 +0,0 @@-module MyLib (someFunc) where--someFunc :: IO ()-someFunc = putStrLn "someFunc"
− test/testdata/cabal-helper/simple-cabal/Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
− test/testdata/cabal-helper/simple-cabal/simple-cabal-test.cabal
@@ -1,10 +0,0 @@-cabal-version:       >=1.10-name:                simple-cabal-test-version:             0.1.0.0-license-file:        LICENSE-build-type:          Simple--library-  exposed-modules:     MyLib-  build-depends:       base-  default-language:    Haskell2010
− test/testdata/cabal-helper/simple-stack/MyLib.hs
@@ -1,4 +0,0 @@-module MyLib (someFunc) where--someFunc :: IO ()-someFunc = putStrLn "someFunc"
− test/testdata/cabal-helper/simple-stack/Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
− test/testdata/cabal-helper/simple-stack/simple-stack-test.cabal
@@ -1,10 +0,0 @@-cabal-version:       >=1.10-name:                simple-stack-test-version:             0.1.0.0-license-file:        LICENSE-build-type:          Simple--library-  exposed-modules:     MyLib-  build-depends:       base-  default-language:    Haskell2010
− test/testdata/cabal-helper/sub-package/Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
− test/testdata/cabal-helper/sub-package/app/Main.hs
@@ -1,8 +0,0 @@-module Main where--import qualified MyLib (someFunc)--main :: IO ()-main = do-  putStrLn "Hello, Haskell!"-  MyLib.someFunc
− test/testdata/cabal-helper/sub-package/plugins-api/PluginLib.hs
@@ -1,4 +0,0 @@-module PluginLib (someFunc) where--someFunc :: IO ()-someFunc = putStrLn "someFunc"
− test/testdata/cabal-helper/sub-package/plugins-api/Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
− test/testdata/cabal-helper/sub-package/plugins-api/plugins-api.cabal
@@ -1,10 +0,0 @@-cabal-version:       >=1.10-name:                plugins-api-version:             0.1.0.0-license-file:        LICENSE-build-type:          Simple--library-  exposed-modules:     PluginLib-  build-depends:       base-  default-language:    Haskell2010
− test/testdata/cabal-helper/sub-package/src/MyLib.hs
@@ -1,6 +0,0 @@-module MyLib (someFunc) where--import qualified PluginLib as L--someFunc :: IO ()-someFunc = L.someFunc
− test/testdata/cabal-helper/sub-package/sub-package.cabal
@@ -1,17 +0,0 @@-cabal-version:       >=1.10-name:                sub-package-version:             0.1.0.0-license-file:        LICENSE-build-type:          Simple--library-  exposed-modules:     MyLib-  build-depends:       base, plugins-api-  hs-source-dirs:      src-  default-language:    Haskell2010--executable sub-package-  main-is:             Main.hs-  build-depends:       base, sub-package-  hs-source-dirs:      app-  default-language:    Haskell2010
+ test/testdata/diagnostics/Foo.hs view
@@ -0,0 +1,2 @@+main = undefined+foo x = id x
− test/testdata/hlint/ApplyRefact1.hs
@@ -1,5 +0,0 @@-{-# LANGUAGE LambdaCase #-}-module ApplyRefact1 where--f = \case "true" -> (True)-          _ -> False
− test/testdata/hlint/ApplyRefact2.hs
@@ -1,2 +0,0 @@-main = undefined-foo x = id x
− test/testdata/hlint/ApplyRefact3.hs
@@ -1,8 +0,0 @@-{-# LANGUAGE CPP #-}-module ApplyRefact3 where--#ifdef FLAG-f = (1)-#else-g = 2-#endif
− test/testdata/hlint/ApplyRefact4.hs
@@ -1,5 +0,0 @@-module ApplyRefact4 where--{-# ANN module "HLint: ignore Redundant bracket" #-}-f = (1)-
− test/testdata/hlint/ApplyRefact5.hs
@@ -1,7 +0,0 @@-module ApplyRefact5 where--{- HLINT ignore "Redundant bracket" -}-f = (1)--{-# HLINT ignore "Use camelCase" #-}-camel_case = undefined
− test/testdata/hlint/ApplyRefact6.hs
@@ -1,11 +0,0 @@--- comment before header-module ApplyRefact6 where--{-# standalone annotation #-}---- standalone comment---- | haddock comment-f = {- inline comment -} ({- inline comment inside refactored code -}1) -- ending comment---- final comment
− test/testdata/hlint/ApplyRefact7.hs
@@ -1,2 +0,0 @@-main = undefined-foo x y = [x, x] ++ y
− test/testdata/hlint/ApplyRefact8.hs
@@ -1,3 +0,0 @@-f = (1)-g = (1)-
− test/testdata/hlint/cpp/ApplyRefact2.hs
@@ -1,9 +0,0 @@-module ApplyRefact2 where--#include "test.h"--#ifdef TEST-f = (1)-#else-f = 1-#endif
− test/testdata/hlint/cpp/ApplyRefact3.hs
@@ -1,7 +0,0 @@-module ApplyRefact3 where--#ifdef FLAG-f = (1)-#else-g = 2-#endif
− test/testdata/hlint/cpp/hie.yaml
@@ -1,7 +0,0 @@-cradle:-  direct:-    arguments:-      - "-XCPP"-      - "-DFLAG"-      - "ApplyRefact3"-      - "ApplyRefact2"
− test/testdata/hlint/cpp/test.h
@@ -1,1 +0,0 @@-#define TEST
− test/testdata/hlint/hie.yaml
@@ -1,11 +0,0 @@-cradle:-  direct:-    arguments:-      - "-DFLAG"-      - "-Wno-unrecognised-pragmas"-      - "ApplyRefact1"-      - "ApplyRefact2"-      - "ApplyRefact3"-      - "ApplyRefact4"-      - "ApplyRefact5"-      - "ApplyRefact6"
− test/testdata/hlint/ignore/.hlint.yaml
@@ -1,2 +0,0 @@-- ignore: { name: "Redundant bracket" }-- ignore: { name: "Use camelCase" }
− test/testdata/hlint/ignore/ApplyRefact.hs
@@ -1,5 +0,0 @@-module ApplyRefact where--f = (1)--camel_case = undefined
− test/testdata/hlint/ignore/hie.yaml
@@ -1,4 +0,0 @@-cradle:-  direct:-    arguments:-      - "ApplyRefact"
− test/testdata/hlint/lambdacase/ApplyRefact1.hs
@@ -1,4 +0,0 @@-module ApplyRefact1 where--f = \case "true" -> (True)-          _ -> False
− test/testdata/hlint/lambdacase/hie.yaml
@@ -1,5 +0,0 @@-cradle:-  direct:-    arguments:-      - "-XLambdaCase"-      - "ApplyRefact1"
− test/testdata/hlint/test-hlint-config.yaml
@@ -1,1 +0,0 @@-- ignore: { name: Eta reduce }
− test/testdata/hlint/typeapps/ApplyRefact1.hs
@@ -1,3 +0,0 @@-module ApplyRefact1 where--a = (id @Int 1)
− test/testdata/hlint/typeapps/hie.yaml
@@ -1,5 +0,0 @@-cradle:-  direct:-    arguments:-      - "-XTypeApplications"-      - "ApplyRefact1"
test/utils/Test/Hls/Flags.hs view
@@ -1,28 +1,13 @@ {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -Wno-unused-imports #-} -- | Module for disabling tests if their plugins are disabled+-- DEPRECATED: To be removed when all plugin tests are in their own packages module Test.Hls.Flags where  import           Test.Hls (TestTree, ignoreTestBecause)  -- * Plugin dependent tests --- | Disable test unless the class flag is set-requiresClassPlugin           :: TestTree -> TestTree-#if class-requiresClassPlugin           = id-#else-requiresClassPlugin           = ignoreTestBecause "Class plugin disabled"-#endif---- | Disable test unless the haddockComments flag is set-requiresHaddockCommentsPlugin :: TestTree -> TestTree-#if haddockComments-requiresHaddockCommentsPlugin = id-#else-requiresHaddockCommentsPlugin = ignoreTestBecause "HaddockComments plugin disabled"-#endif- -- | Disable test unless the eval flag is set requiresEvalPlugin            :: TestTree -> TestTree #if eval@@ -31,71 +16,6 @@ requiresEvalPlugin            = ignoreTestBecause "Eval plugin disabled" #endif --- | Disable test unless the importLens flag is set-requiresImportLensPlugin      :: TestTree -> TestTree-#if importLens-requiresImportLensPlugin      = id-#else-requiresImportLensPlugin      = ignoreTestBecause "ImportLens plugin disabled"-#endif---- | Disable test unless the rename flag is set-requiresRenamePlugin          :: TestTree -> TestTree-#if rename-requiresRenamePlugin          = id-#else-requiresRenamePlugin          = ignoreTestBecause "Rename plugin disabled"-#endif---- | Disable test unless the retrie flag is set-requiresRetriePlugin          :: TestTree -> TestTree-#if retrie-requiresRetriePlugin          = id-#else-requiresRetriePlugin          = ignoreTestBecause "Retrie plugin disabled"-#endif---- | Disable test unless the tactic flag is set-requiresTacticPlugin          :: TestTree -> TestTree-#if tactic-requiresTacticPlugin          = id-#else-requiresTacticPlugin          = ignoreTestBecause "Tactic plugin disabled"-#endif---- | Disable test unless the hlint flag is set-requiresHlintPlugin           :: TestTree -> TestTree-#if hlint-requiresHlintPlugin           = id-#else-requiresHlintPlugin           = ignoreTestBecause "Hlint plugin disabled"-#endif---- | Disable test unless the moduleName flag is set-requiresModuleNamePlugin      :: TestTree -> TestTree-#if moduleName-requiresModuleNamePlugin      = id-#else-requiresModuleNamePlugin      = ignoreTestBecause "ModuleName plugin disabled"-#endif---- | Disable test unless the pragmas flag is set-requiresPragmasPlugin         :: TestTree -> TestTree-#if pragmas-requiresPragmasPlugin         = id-#else-requiresPragmasPlugin         = ignoreTestBecause "Pragmas plugin disabled"-#endif---- | Disable test unless the splice flag is set-requiresSplicePlugin          :: TestTree -> TestTree-#if splice-requiresSplicePlugin          = id-#else-requiresSplicePlugin          = ignoreTestBecause "Splice plugin disabled"-#endif-- -- * Formatters -- | Disable test unless the floskell flag is set requiresFloskellPlugin        :: TestTree -> TestTree@@ -120,20 +40,3 @@ #else requiresOrmoluPlugin          = ignoreTestBecause "Ormolu plugin disabled" #endif---- | Disable test unless the stylishHaskell flag is set-requiresStylishHaskellPlugin  :: TestTree -> TestTree-#if stylishHaskell-requiresStylishHaskellPlugin  = id-#else-requiresStylishHaskellPlugin  = ignoreTestBecause "StylishHaskell plugin disabled"-#endif---- | Disable test unless the brittany flag is set-requiresBrittanyPlugin        :: TestTree -> TestTree-#if brittany-requiresBrittanyPlugin        = id-#else-requiresBrittanyPlugin        = ignoreTestBecause "Brittany plugin disabled"-#endif-
test/wrapper/Main.hs view
@@ -11,8 +11,8 @@  projectGhcVersionTests :: TestTree projectGhcVersionTests = testGroup "--project-ghc-version"-  [ testCase "stack with ghc 8.10.4" $-      testDir "test/wrapper/testdata/stack-8.10.4" "8.10.4"+  [ testCase "stack with ghc 8.10.7" $+      testDir "test/wrapper/testdata/stack-8.10.7" "8.10.7"   , testCase "stack with ghc 8.8.3" $       testDir "test/wrapper/testdata/stack-8.8.3" "8.8.3"   , testCase "cabal with global ghc" $ do