From 1be17d4b9ecfd574b1cf72620da127fa0a7a2cb7 Mon Sep 17 00:00:00 2001 From: Sandy Maguire Date: Mon, 19 Oct 2020 11:44:58 -0700 Subject: [PATCH] Separate tactics into its own package (#516) Move the tactics plugin into a separate package, completely distinct form the hls exe which previously hosted this code. This is the first step towards moving tactics out of hls proper entirely. --- cabal.project | 1 + haskell-language-server.cabal | 24 +----- hie.yaml.cbl | 2 +- hie.yaml.stack | 2 +- plugins/default/src/Ide/Plugin/ModuleName.hs | 1 - plugins/tactics/hls-tactics-plugin.cabal | 80 ++++++++++++++++++++ stack-8.10.1.yaml | 1 + stack-8.10.2.yaml | 1 + stack-8.6.4.yaml | 1 + stack-8.6.5.yaml | 1 + stack-8.8.2.yaml | 1 + stack-8.8.3.yaml | 1 + stack-8.8.4.yaml | 1 + 13 files changed, 92 insertions(+), 25 deletions(-) create mode 100644 plugins/tactics/hls-tactics-plugin.cabal diff --git a/cabal.project b/cabal.project index 7d23377471..886411c714 100644 --- a/cabal.project +++ b/cabal.project @@ -2,6 +2,7 @@ packages: ./ ghcide hls-plugin-api + ./plugins/tactics source-repository-package type: git diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 4f75fad4c6..6b514fc6f4 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -80,7 +80,7 @@ library executable haskell-language-server import: agpl, common-deps main-is: Main.hs - hs-source-dirs: exe plugins/default/src plugins/tactics/src + hs-source-dirs: exe plugins/default/src other-modules: Ide.Plugin.Eval Ide.Plugin.Example @@ -93,21 +93,6 @@ executable haskell-language-server Ide.Plugin.Pragmas Ide.Plugin.Retrie Ide.Plugin.StylishHaskell - Ide.Plugin.Tactic - Ide.Plugin.Tactic.Auto - Ide.Plugin.Tactic.CodeGen - Ide.Plugin.Tactic.Context - Ide.Plugin.Tactic.Debug - Ide.Plugin.Tactic.GHC - Ide.Plugin.Tactic.Judgements - Ide.Plugin.Tactic.KnownStrategies - Ide.Plugin.Tactic.Machinery - Ide.Plugin.Tactic.Naming - Ide.Plugin.Tactic.Range - Ide.Plugin.Tactic.Tactics - Ide.Plugin.Tactic.Types - Ide.Plugin.Tactic.TestTypes - Ide.TreeTransform ghc-options: -threaded -Wall -Wno-name-shadowing -Wredundant-constraints @@ -135,6 +120,7 @@ executable haskell-language-server , haskell-language-server , haskell-lsp ^>=0.22 , hls-plugin-api + , hls-tactics-plugin , lens , ormolu ^>=0.1.2 , regex-tdfa @@ -153,15 +139,9 @@ executable haskell-language-server , stylish-haskell ^>=0.12 , temporary , text - , syb , time , transformers , unordered-containers - , ghc-source-gen - , refinery ^>=0.3 - , ghc-exactprint - , fingertree - , generic-lens if flag(agpl) build-depends: brittany diff --git a/hie.yaml.cbl b/hie.yaml.cbl index 46730ab9d9..af9ba677d6 100644 --- a/hie.yaml.cbl +++ b/hie.yaml.cbl @@ -26,7 +26,7 @@ cradle: component: "haskell-language-server:exe:haskell-language-server" - path: "./plugins/tactics/src" - component: "haskell-language-server:exe:haskell-language-server" + component: "lib:hls-tactics-plugin" - path: "./exe/Wrapper.hs" component: "haskell-language-server:exe:haskell-language-server-wrapper" diff --git a/hie.yaml.stack b/hie.yaml.stack index f9400d0914..1c5362b45f 100644 --- a/hie.yaml.stack +++ b/hie.yaml.stack @@ -22,7 +22,7 @@ cradle: - path: "./plugins/default/src" component: "haskell-language-server:exe:haskell-language-server" - path: "./plugins/tactics/src" - component: "haskell-language-server:exe:haskell-language-server" + component: "hls-tactics-plugin:lib:hls-tactics-plugin" - path: "./exe/Arguments.hs" component: "haskell-language-server:exe:haskell-language-server" diff --git a/plugins/default/src/Ide/Plugin/ModuleName.hs b/plugins/default/src/Ide/Plugin/ModuleName.hs index 97ffbe0abf..a7b878f387 100644 --- a/plugins/default/src/Ide/Plugin/ModuleName.hs +++ b/plugins/default/src/Ide/Plugin/ModuleName.hs @@ -94,7 +94,6 @@ import Development.IDE.Core.Shake import Data.Text ( pack ) import System.Directory ( canonicalizePath ) import Data.List -import Ide.Plugin.Tactic.Debug ( unsafeRender ) -- |Plugin descriptor descriptor :: PluginId -> PluginDescriptor descriptor plId = (defaultPluginDescriptor plId) diff --git a/plugins/tactics/hls-tactics-plugin.cabal b/plugins/tactics/hls-tactics-plugin.cabal new file mode 100644 index 0000000000..9abb2b549d --- /dev/null +++ b/plugins/tactics/hls-tactics-plugin.cabal @@ -0,0 +1,80 @@ +cabal-version: 2.2 +category: Development +name: hls-tactics-plugin +version: 0.5.1.0 +synopsis: LSP server for GHC +description: + Please see the README on GitHub at + +homepage: https://github.com/isovector/hls-tactics-plugin#readme +bug-reports: https://github.com/isovector/hls-tactics-plugin/issues +author: Sandy Maguire, Reed Mullanix +maintainer: sandy@sandymaguire.me +copyright: Sandy Maguire, Reed Mullanix +-- license: Apache-2.0 +-- license-file: LICENSE +build-type: Simple +-- extra-source-files: +-- README.md +-- ChangeLog.md + +flag pedantic + description: Enable -Werror + default: False + manual: True + +source-repository head + type: git + location: https://github.com/isovector/hls-tactics-plugin + +library + hs-source-dirs: src + exposed-modules: + Ide.Plugin.Tactic + Ide.Plugin.Tactic.Auto + Ide.Plugin.Tactic.CodeGen + Ide.Plugin.Tactic.Context + Ide.Plugin.Tactic.Debug + Ide.Plugin.Tactic.GHC + Ide.Plugin.Tactic.Judgements + Ide.Plugin.Tactic.KnownStrategies + Ide.Plugin.Tactic.Machinery + Ide.Plugin.Tactic.Naming + Ide.Plugin.Tactic.Range + Ide.Plugin.Tactic.Tactics + Ide.Plugin.Tactic.Types + Ide.Plugin.Tactic.TestTypes + Ide.TreeTransform + + ghc-options: + -Wno-name-shadowing -Wredundant-constraints + if flag(pedantic) + ghc-options: -Werror + + build-depends: + , aeson + , base >=4.12 && <5 + , containers + , directory + , extra + , filepath + , fingertree + , generic-lens + , ghc + , ghc-boot-th + , ghc-exactprint + , ghc-source-gen + , ghcide >=0.1 + , haskell-lsp ^>=0.22 + , hls-plugin-api + , lens + , mtl + , refinery ^>=0.3 + , retrie >=0.1.1.0 + , shake >=0.17.5 + , syb + , text + , transformers + + default-language: Haskell2010 + diff --git a/stack-8.10.1.yaml b/stack-8.10.1.yaml index 8353abf148..577041af4a 100644 --- a/stack-8.10.1.yaml +++ b/stack-8.10.1.yaml @@ -4,6 +4,7 @@ packages: - . - ./ghcide/ - ./hls-plugin-api +- ./plugins/tactics ghc-options: "$everything": -haddock diff --git a/stack-8.10.2.yaml b/stack-8.10.2.yaml index 66fa833fb6..3570c1cdb5 100644 --- a/stack-8.10.2.yaml +++ b/stack-8.10.2.yaml @@ -4,6 +4,7 @@ packages: - . - ./ghcide/ - ./hls-plugin-api +- ./plugins/tactics ghc-options: "$everything": -haddock diff --git a/stack-8.6.4.yaml b/stack-8.6.4.yaml index 9796b068ef..e27a62be4f 100644 --- a/stack-8.6.4.yaml +++ b/stack-8.6.4.yaml @@ -5,6 +5,7 @@ packages: - . - ./ghcide/ - ./hls-plugin-api +- ./plugins/tactics ghc-options: "$everything": -haddock diff --git a/stack-8.6.5.yaml b/stack-8.6.5.yaml index 1a0b67c2b2..93a47a3472 100644 --- a/stack-8.6.5.yaml +++ b/stack-8.6.5.yaml @@ -4,6 +4,7 @@ packages: - . - ./ghcide/ - ./hls-plugin-api +- ./plugins/tactics ghc-options: "$everything": -haddock diff --git a/stack-8.8.2.yaml b/stack-8.8.2.yaml index 94ad80cd99..3b780ed048 100644 --- a/stack-8.8.2.yaml +++ b/stack-8.8.2.yaml @@ -4,6 +4,7 @@ packages: - . - ./ghcide/ - ./hls-plugin-api +- ./plugins/tactics ghc-options: "$everything": -haddock diff --git a/stack-8.8.3.yaml b/stack-8.8.3.yaml index c01a2649e1..07e3e6310f 100644 --- a/stack-8.8.3.yaml +++ b/stack-8.8.3.yaml @@ -4,6 +4,7 @@ packages: - . - ./ghcide/ - ./hls-plugin-api +- ./plugins/tactics ghc-options: "$everything": -haddock diff --git a/stack-8.8.4.yaml b/stack-8.8.4.yaml index 57518e9e24..3627d24139 100644 --- a/stack-8.8.4.yaml +++ b/stack-8.8.4.yaml @@ -4,6 +4,7 @@ packages: - . - ./ghcide/ - ./hls-plugin-api +- ./plugins/tactics ghc-options: "$everything": -haddock