From 99e940647cb31f604279277669b6b6b6c69dd180 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 29 Apr 2024 20:13:18 +0800 Subject: [PATCH 1/2] pull ghcide-bench out of ghcide and merge some of the hls-test-utils with ghcide-tests --- cabal.project | 1 - ghcide-bench/ghcide-bench.cabal | 108 ------------------ ghcide/ghcide.cabal | 2 - haskell-language-server.cabal | 98 +++++++++++++++- hls-test-utils/hls-test-utils.cabal | 2 + .../src/Development/IDE/Test.hs | 2 + .../src/Development/IDE/Test/Diagnostic.hs | 0 7 files changed, 100 insertions(+), 113 deletions(-) delete mode 100644 ghcide-bench/ghcide-bench.cabal rename {ghcide/test => hls-test-utils}/src/Development/IDE/Test.hs (99%) rename {ghcide/test => hls-test-utils}/src/Development/IDE/Test/Diagnostic.hs (100%) diff --git a/cabal.project b/cabal.project index b5d8d0ff1e..988d56d47a 100644 --- a/cabal.project +++ b/cabal.project @@ -4,7 +4,6 @@ packages: ./shake-bench ./hls-graph ./ghcide - ./ghcide-bench ./hls-plugin-api ./hls-test-utils diff --git a/ghcide-bench/ghcide-bench.cabal b/ghcide-bench/ghcide-bench.cabal deleted file mode 100644 index 794a551c7c..0000000000 --- a/ghcide-bench/ghcide-bench.cabal +++ /dev/null @@ -1,108 +0,0 @@ -cabal-version: 3.0 -build-type: Simple -category: Development -name: ghcide-bench -version: 2.7.0.0 -license: Apache-2.0 -license-file: LICENSE -author: The Haskell IDE team -maintainer: pepeiborra@gmail.com -copyright: The Haskell IDE team -synopsis: An LSP client for running performance experiments on HLS -description: An LSP client for running performance experiments on HLS -homepage: https://github.com/haskell/haskell-language-server/tree/master/ghcide#readme -bug-reports: https://github.com/haskell/haskell-language-server/issues -tested-with: GHC == 9.0.2 || == 9.2.5 - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -executable ghcide-bench - default-language: GHC2021 - build-depends: - aeson, - base, - bytestring, - containers, - data-default, - directory, - extra, - filepath, - hls-plugin-api, - lens, - ghcide-bench, - lsp-test, - lsp-types, - optparse-applicative, - process, - safe-exceptions, - hls-graph, - shake, - tasty-hunit >= 0.10, - text - hs-source-dirs: exe - ghc-options: -threaded -Wall -Wno-name-shadowing -rtsopts - main-is: Main.hs - default-extensions: - LambdaCase - OverloadedStrings - RecordWildCards - ViewPatterns - -library - default-language: GHC2021 - hs-source-dirs: src - ghc-options: -Wall -Wno-name-shadowing - exposed-modules: - Experiments.Types - Experiments - build-depends: - aeson, - async, - base == 4.*, - binary, - bytestring, - deepseq, - directory, - extra, - filepath, - ghcide:{ghcide, ghcide-test-utils}, - hashable, - lens, - lsp-test, - lsp-types, - optparse-applicative, - parser-combinators, - process, - safe-exceptions, - shake, - text, - row-types - default-extensions: - LambdaCase - RecordWildCards - ViewPatterns - -test-suite test - type: exitcode-stdio-1.0 - default-language: GHC2021 - build-tool-depends: - ghcide:ghcide, - main-is: Main.hs - hs-source-dirs: test - ghc-options: -Wunused-packages - ghc-options: -threaded -Wall - build-depends: - base, - extra, - ghcide-bench, - lsp-test ^>= 0.17, - tasty, - tasty-hunit >= 0.10, - tasty-rerun, - default-extensions: - LambdaCase - OverloadedStrings - RecordWildCards - ViewPatterns diff --git a/ghcide/ghcide.cabal b/ghcide/ghcide.cabal index 57f2b28770..8332a7e7bd 100644 --- a/ghcide/ghcide.cabal +++ b/ghcide/ghcide.cabal @@ -272,9 +272,7 @@ library ghcide-test-utils hs-source-dirs: test/src test/cabal exposed-modules: - Development.IDE.Test Development.IDE.Test.Runfiles - Development.IDE.Test.Diagnostic build-depends: aeson, diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 1c52e437a8..17569b0615 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -2074,7 +2074,7 @@ benchmark benchmark main-is: Main.hs hs-source-dirs: bench build-tool-depends: - ghcide-bench:ghcide-bench, + haskell-language-server:ghcide-bench, hp2pretty:hp2pretty, default-extensions: LambdaCase @@ -2089,7 +2089,7 @@ benchmark benchmark , directory , extra , filepath - , ghcide-bench + , haskell-language-server:ghcide-bench-lib , haskell-language-server , hls-plugin-api , lens @@ -2199,3 +2199,97 @@ test-suite ghcide-tests OverloadedStrings RecordWildCards ViewPatterns + + +executable ghcide-bench + default-language: GHC2021 + build-depends: + aeson, + base, + bytestring, + containers, + data-default, + directory, + extra, + filepath, + hls-plugin-api, + hls-test-utils, + lens, + lsp-test, + lsp-types, + optparse-applicative, + process, + safe-exceptions, + hls-graph, + shake, + tasty-hunit >= 0.10, + text, + haskell-language-server:ghcide-bench-lib, + hs-source-dirs: ghcide-bench/exe + ghc-options: -threaded -Wall -Wno-name-shadowing -rtsopts + main-is: Main.hs + default-extensions: + LambdaCase + OverloadedStrings + RecordWildCards + ViewPatterns + +library ghcide-bench-lib + default-language: GHC2021 + hs-source-dirs: ghcide-bench/src + ghc-options: -Wall -Wno-name-shadowing + exposed-modules: + Experiments.Types + Experiments + build-depends: + aeson, + async, + base == 4.*, + binary, + bytestring, + deepseq, + directory, + extra, + filepath, + ghcide:{ghcide, ghcide-test-utils}, + hashable, + lens, + lsp-test, + lsp-types, + optparse-applicative, + parser-combinators, + process, + safe-exceptions, + shake, + text, + hls-test-utils, + row-types + default-extensions: + LambdaCase + RecordWildCards + ViewPatterns + + +test-suite ghcide-bench-test + type: exitcode-stdio-1.0 + default-language: GHC2021 + build-tool-depends: + ghcide:ghcide, + main-is: Main.hs + hs-source-dirs: ghcide-bench/test + ghc-options: -Wunused-packages + ghc-options: -threaded -Wall + build-depends: + base, + extra, + haskell-language-server:ghcide-bench-lib, + lsp-test ^>= 0.17, + tasty, + tasty-hunit >= 0.10, + tasty-rerun, + hls-test-utils + default-extensions: + LambdaCase + OverloadedStrings + RecordWildCards + ViewPatterns diff --git a/hls-test-utils/hls-test-utils.cabal b/hls-test-utils/hls-test-utils.cabal index a5288da92f..f1a772565e 100644 --- a/hls-test-utils/hls-test-utils.cabal +++ b/hls-test-utils/hls-test-utils.cabal @@ -29,6 +29,8 @@ library Test.Hls Test.Hls.Util Test.Hls.FileSystem + Development.IDE.Test + Development.IDE.Test.Diagnostic hs-source-dirs: src build-depends: diff --git a/ghcide/test/src/Development/IDE/Test.hs b/hls-test-utils/src/Development/IDE/Test.hs similarity index 99% rename from ghcide/test/src/Development/IDE/Test.hs rename to hls-test-utils/src/Development/IDE/Test.hs index adaa5801c0..136357b0f2 100644 --- a/ghcide/test/src/Development/IDE/Test.hs +++ b/hls-test-utils/src/Development/IDE/Test.hs @@ -4,6 +4,8 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE OverloadedStrings #-} module Development.IDE.Test ( Cursor diff --git a/ghcide/test/src/Development/IDE/Test/Diagnostic.hs b/hls-test-utils/src/Development/IDE/Test/Diagnostic.hs similarity index 100% rename from ghcide/test/src/Development/IDE/Test/Diagnostic.hs rename to hls-test-utils/src/Development/IDE/Test/Diagnostic.hs From 04b7e84a24f8f595e074793f4d12aee466f614ed Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 29 Apr 2024 20:26:21 +0800 Subject: [PATCH 2/2] fix style --- hls-test-utils/src/Development/IDE/Test.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hls-test-utils/src/Development/IDE/Test.hs b/hls-test-utils/src/Development/IDE/Test.hs index 136357b0f2..b128666ff1 100644 --- a/hls-test-utils/src/Development/IDE/Test.hs +++ b/hls-test-utils/src/Development/IDE/Test.hs @@ -4,8 +4,8 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE GADTs #-} -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE OverloadedStrings #-} module Development.IDE.Test ( Cursor