Skip to content

Commit

Permalink
add a prefix to plugin CPP
Browse files Browse the repository at this point in the history
  • Loading branch information
kokobd committed Jul 29, 2022
1 parent 347a718 commit f6b7e85
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 72 deletions.
97 changes: 48 additions & 49 deletions exe/Plugins.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,101 +16,100 @@ import qualified Ide.Plugin.Example2 as Example2
import qualified Ide.Plugin.ExampleCabal as ExampleCabal

-- haskell-language-server optional plugins
#if qualifyImportedNames
#if hls_qualifyImportedNames
import qualified Ide.Plugin.QualifyImportedNames as QualifyImportedNames
#endif

#if callHierarchy
#if hls_callHierarchy
import qualified Ide.Plugin.CallHierarchy as CallHierarchy
#endif

#if class
#if hls_class
import qualified Ide.Plugin.Class as Class
#endif

#if haddockComments
#if hls_haddockComments
import qualified Ide.Plugin.HaddockComments as HaddockComments
#endif

#if eval
#if hls_eval
import qualified Ide.Plugin.Eval as Eval
#endif

#if importLens
#if hls_importLens
import qualified Ide.Plugin.ExplicitImports as ExplicitImports
#endif

#if refineImports
#if hls_refineImports
import qualified Ide.Plugin.RefineImports as RefineImports
#endif

#if rename
#if hls_rename
import qualified Ide.Plugin.Rename as Rename
#endif

#if retrie
#if hls_retrie
import qualified Ide.Plugin.Retrie as Retrie
#endif

#if tactic
#if hls_tactic
import qualified Ide.Plugin.Tactic as Tactic
#endif

#if hlint
#if hls_hlint
import qualified Ide.Plugin.Hlint as Hlint
#endif

#if stan
#if hls_stan
import qualified Ide.Plugin.Stan as Stan
#endif


#if moduleName
#if hls_moduleName
import qualified Ide.Plugin.ModuleName as ModuleName
#endif

#if pragmas
#if hls_pragmas
import qualified Ide.Plugin.Pragmas as Pragmas
#endif

#if splice
#if hls_splice
import qualified Ide.Plugin.Splice as Splice
#endif

#if alternateNumberFormat
#if hls_alternateNumberFormat
import qualified Ide.Plugin.AlternateNumberFormat as AlternateNumberFormat
#endif

#if codeRange
#if hls_codeRange
import qualified Ide.Plugin.CodeRange as CodeRange
#endif

#if changeTypeSignature
#if hls_changeTypeSignature
import Ide.Plugin.ChangeTypeSignature as ChangeTypeSignature
#endif

#if gadt
#if hls_gadt
import Ide.Plugin.GADT as GADT
#endif
-- formatters

#if floskell
#if hls_floskell
import qualified Ide.Plugin.Floskell as Floskell
#endif

#if fourmolu
#if hls_fourmolu
import qualified Ide.Plugin.Fourmolu as Fourmolu
#endif

#if ormolu
#if hls_ormolu
import qualified Ide.Plugin.Ormolu as Ormolu
#endif

#if stylishHaskell
#if hls_stylishHaskell
import qualified Ide.Plugin.StylishHaskell as StylishHaskell
#endif

#if brittany
#if hls_brittany
import qualified Ide.Plugin.Brittany as Brittany
#endif

Expand All @@ -135,76 +134,76 @@ idePlugins recorder includeExamples = pluginDescToIdePlugins allPlugins
then basePlugins ++ examplePlugins
else basePlugins
basePlugins =
#if pragmas
#if hls_pragmas
Pragmas.descriptor "pragmas" :
#endif
#if floskell
#if hls_floskell
Floskell.descriptor "floskell" :
#endif
#if fourmolu
#if hls_fourmolu
Fourmolu.descriptor pluginRecorder "fourmolu" :
#endif
#if tactic
#if hls_tactic
Tactic.descriptor pluginRecorder "tactics" :
#endif
#if ormolu
#if hls_ormolu
Ormolu.descriptor "ormolu" :
#endif
#if stylishHaskell
#if hls_stylishHaskell
StylishHaskell.descriptor "stylish-haskell" :
#endif
#if rename
#if hls_rename
Rename.descriptor "rename" :
#endif
#if retrie
#if hls_retrie
Retrie.descriptor "retrie" :
#endif
#if brittany
#if hls_brittany
Brittany.descriptor "brittany" :
#endif
#if callHierarchy
#if hls_callHierarchy
CallHierarchy.descriptor :
#endif
#if class
#if hls_class
Class.descriptor pluginRecorder "class" :
#endif
#if haddockComments
#if hls_haddockComments
HaddockComments.descriptor "haddockComments" :
#endif
#if eval
#if hls_eval
Eval.descriptor pluginRecorder "eval" :
#endif
#if importLens
#if hls_importLens
ExplicitImports.descriptor pluginRecorder "importLens" :
#endif
#if qualifyImportedNames
#if hls_qualifyImportedNames
QualifyImportedNames.descriptor "qualifyImportedNames" :
#endif
#if refineImports
#if hls_refineImports
RefineImports.descriptor pluginRecorder "refineImports" :
#endif
#if moduleName
#if hls_moduleName
ModuleName.descriptor "moduleName" :
#endif
#if hlint
#if hls_hlint
Hlint.descriptor pluginRecorder "hlint" :
#endif
#if stan
#if hls_stan
Stan.descriptor pluginRecorder "stan" :
#endif
#if splice
#if hls_splice
Splice.descriptor "splice" :
#endif
#if alternateNumberFormat
#if hls_alternateNumberFormat
AlternateNumberFormat.descriptor pluginRecorder :
#endif
#if codeRange
#if hls_codeRange
CodeRange.descriptor pluginRecorder "codeRange" :
#endif
#if changeTypeSignature
#if hls_changeTypeSignature
ChangeTypeSignature.descriptor :
#endif
#if gadt
#if hls_gadt
GADT.descriptor "gadt" :
#endif
-- The ghcide descriptors should come last so that the notification handlers
Expand Down
46 changes: 23 additions & 23 deletions haskell-language-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,17 @@ common example-plugins
common class
if flag(class)
build-depends: hls-class-plugin ^>= 1.0
cpp-options: -Dclass
cpp-options: -Dhls_class

common callHierarchy
if flag(callHierarchy)
build-depends: hls-call-hierarchy-plugin ^>= 1.0
cpp-options: -DcallHierarchy
cpp-options: -Dhls_callHierarchy

common haddockComments
if flag(haddockComments) && (impl(ghc < 9.2.1) || flag(ignore-plugins-ghc-bounds))
build-depends: hls-haddock-comments-plugin ^>= 1.0
cpp-options: -DhaddockComments
cpp-options: -Dhls_haddockComments

common eval
if flag(eval)
Expand All @@ -257,104 +257,104 @@ common eval
common importLens
if flag(importLens)
build-depends: hls-explicit-imports-plugin ^>= 1.1
cpp-options: -DimportLens
cpp-options: -Dhls_importLens

common refineImports
if flag(refineImports)
build-depends: hls-refine-imports-plugin ^>=1.0
cpp-options: -DrefineImports
cpp-options: -Dhls_refineImports

common rename
if flag(rename)
build-depends: hls-rename-plugin ^>= 1.0
cpp-options: -Drename
cpp-options: -Dhls_rename

common retrie
if flag(retrie) && (impl(ghc < 9.2.1) || flag(ignore-plugins-ghc-bounds))
build-depends: hls-retrie-plugin ^>= 1.0
cpp-options: -Dretrie
cpp-options: -Dhls_retrie

common tactic
if flag(tactic) && (impl(ghc < 9.2.1) || flag(ignore-plugins-ghc-bounds))
build-depends: hls-tactics-plugin >=1.2.0.0 && <1.7
cpp-options: -Dtactic
cpp-options: -Dhls_tactic

common hlint
if flag(hlint)
build-depends: hls-hlint-plugin ^>= 1.0
cpp-options: -Dhlint
cpp-options: -Dhls_hlint

common stan
if flag(stan) && (impl(ghc >= 8.8) && impl(ghc < 9.0))
build-depends: hls-stan-plugin ^>= 1.0
cpp-options: -Dstan
cpp-options: -Dhls_stan

common moduleName
if flag(moduleName)
build-depends: hls-module-name-plugin ^>= 1.0
cpp-options: -DmoduleName
cpp-options: -Dhls_moduleName

common pragmas
if flag(pragmas)
build-depends: hls-pragmas-plugin ^>= 1.0
cpp-options: -Dpragmas
cpp-options: -Dhls_pragmas

common splice
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
cpp-options: -Dhls_splice

common alternateNumberFormat
if flag(alternateNumberFormat)
build-depends: hls-alternate-number-format-plugin ^>= 1.1
cpp-options: -DalternateNumberFormat
cpp-options: -Dhls_alternateNumberFormat

common qualifyImportedNames
if flag(qualifyImportedNames)
build-depends: hls-qualify-imported-names-plugin ^>=1.0
cpp-options: -DqualifyImportedNames
cpp-options: -Dhls_qualifyImportedNames

common codeRange
if flag(codeRange)
build-depends: hls-code-range-plugin ^>= 1.0
cpp-options: -DcodeRange
cpp-options: -Dhls_codeRange

common changeTypeSignature
if flag(changeTypeSignature)
build-depends: hls-change-type-signature-plugin ^>= 1.0
cpp-options: -DchangeTypeSignature
cpp-options: -Dhls_changeTypeSignature

common gadt
if flag(gadt)
build-depends: hls-gadt-plugin ^>= 1.0
cpp-options: -Dgadt
cpp-options: -Dhls_gadt

-- formatters

common floskell
if flag(floskell)
build-depends: hls-floskell-plugin ^>= 1.0
cpp-options: -Dfloskell
cpp-options: -Dhls_floskell

common fourmolu
if flag(fourmolu)
build-depends: hls-fourmolu-plugin ^>= 1.0
cpp-options: -Dfourmolu
cpp-options: -Dhls_fourmolu

common ormolu
if flag(ormolu)
build-depends: hls-ormolu-plugin ^>= 1.0
cpp-options: -Dormolu
cpp-options: -Dhls_ormolu

common stylishHaskell
if flag(stylishHaskell)
build-depends: hls-stylish-haskell-plugin ^>= 1.0
cpp-options: -DstylishHaskell
cpp-options: -Dhls_stylishHaskell

common brittany
if flag(brittany) && (impl(ghc < 9.0.2) || flag(ignore-plugins-ghc-bounds))
build-depends: hls-brittany-plugin ^>= 1.0
cpp-options: -Dbrittany
cpp-options: -Dhls_brittany

executable haskell-language-server
import: common-deps
Expand Down

0 comments on commit f6b7e85

Please sign in to comment.