-
-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add plugins conditionally at compile time
- Loading branch information
Showing
3 changed files
with
292 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{-# LANGUAGE CPP #-} | ||
{-# LANGUAGE OverloadedStrings #-} | ||
module Plugins where | ||
|
||
import Ide.Types (IdePlugins) | ||
import Ide.Plugin (pluginDescToIdePlugins) | ||
|
||
-- fixed plugins | ||
import Ide.Plugin.Example as Example | ||
import Ide.Plugin.Example2 as Example2 | ||
import Ide.Plugin.GhcIde as GhcIde | ||
|
||
-- haskell-language-server optional plugins | ||
|
||
#if eval | ||
import Ide.Plugin.Eval as Eval | ||
#endif | ||
|
||
#if importLens | ||
import Ide.Plugin.ExplicitImports as ExplicitImports | ||
#endif | ||
|
||
#if retrie | ||
import Ide.Plugin.Retrie as Retrie | ||
#endif | ||
|
||
#if tactic | ||
import Ide.Plugin.Tactic as Tactic | ||
#endif | ||
|
||
#if hlint | ||
import Ide.Plugin.Hlint as Hlint | ||
#endif | ||
|
||
#if moduleName | ||
import Ide.Plugin.ModuleName as ModuleName | ||
#endif | ||
|
||
#if pragmas | ||
import Ide.Plugin.Pragmas as Pragmas | ||
#endif | ||
|
||
-- formatters | ||
|
||
#if floskell | ||
import Ide.Plugin.Floskell as Floskell | ||
#endif | ||
|
||
#if fourmolu | ||
import Ide.Plugin.Fourmolu as Fourmolu | ||
#endif | ||
|
||
#if ormolu | ||
import Ide.Plugin.Ormolu as Ormolu | ||
#endif | ||
|
||
#if stylishHaskell | ||
import Ide.Plugin.StylishHaskell as StylishHaskell | ||
#endif | ||
|
||
#if AGPL && brittany | ||
import Ide.Plugin.Brittany as Brittany | ||
#endif | ||
|
||
-- --------------------------------------------------------------------- | ||
|
||
-- | The plugins configured for use in this instance of the language | ||
-- server. | ||
-- These can be freely added or removed to tailor the available | ||
-- features of the server. | ||
|
||
idePlugins :: Bool -> IdePlugins | ||
idePlugins includeExamples = pluginDescToIdePlugins allPlugins | ||
where | ||
allPlugins = if includeExamples | ||
then basePlugins ++ examplePlugins | ||
else basePlugins | ||
basePlugins = | ||
[ GhcIde.descriptor "ghcide" | ||
#if pragmas | ||
, Pragmas.descriptor "pragmas" | ||
#endif | ||
#if floskell | ||
, Floskell.descriptor "floskell" | ||
#endif | ||
#if fourmolu | ||
, Fourmolu.descriptor "fourmolu" | ||
#endif | ||
#if tactic | ||
, Tactic.descriptor "tactic" | ||
#endif | ||
#if ormolu | ||
, Ormolu.descriptor "ormolu" | ||
#endif | ||
#if stylishHaskell | ||
, StylishHaskell.descriptor "stylish-haskell" | ||
#endif | ||
#if retrie | ||
, Retrie.descriptor "retrie" | ||
#endif | ||
#if AGPL && brittany | ||
, Brittany.descriptor "brittany" | ||
#endif | ||
#if eval | ||
, Eval.descriptor "eval" | ||
#endif | ||
#if importLens | ||
, ExplicitImports.descriptor "importLens" | ||
#endif | ||
#if moduleName | ||
, ModuleName.descriptor "moduleName" | ||
#endif | ||
#if hlint | ||
, Hlint.descriptor "hlint" | ||
#endif | ||
] | ||
examplePlugins = | ||
[Example.descriptor "eg" | ||
,Example2.descriptor "eg2" | ||
] |
Oops, something went wrong.