Skip to content

Commit 69ce1c5

Browse files
committed
Merge branch 'master' into haddock-plugin
2 parents b2e33dd + 0063ec7 commit 69ce1c5

File tree

4 files changed

+322
-100
lines changed

4 files changed

+322
-100
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,20 @@ jobs:
5050
5151
- name: Set some window specific things
5252
if: matrix.os == 'windows-latest'
53-
run: echo "EXE_EXT=.exe" >> $GITHUB_ENV
53+
env:
54+
GHC_VER: ${{ matrix.ghc }}
55+
run: |
56+
echo "EXE_EXT=.exe" >> $GITHUB_ENV
57+
GHC_VER=$(echo $GHC_VER | sed 's/8.10.2.2/8.10.2/g')
58+
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV
5459
5560
- name: Set some linux specific things
5661
if: matrix.os == 'ubuntu-latest'
57-
run: echo "LINUX_CABAL_ARGS=--enable-executable-static --ghc-options=-split-sections" >> $GITHUB_ENV
62+
env:
63+
GHC_VER: ${{ matrix.ghc }}
64+
run: |
65+
echo "LINUX_CABAL_ARGS=--enable-executable-static --ghc-options=-split-sections" >> $GITHUB_ENV
66+
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV
5867
5968
- name: Build Server
6069
# Try building it twice in case of flakey builds on Windows
@@ -64,13 +73,10 @@ jobs:
6473
6574
- name: Compress Server Binary
6675
id: compress_server_binary
67-
env:
68-
GHC_VER: ${{ matrix.ghc }}
6976
run: |
7077
# We normalize windows+choco ghc version 8.10.2.2
71-
GHC_VERSION=$(echo $GHC_VERSION | sed 's/8.10.2.2/8.10.2/g')
7278
HLS_BUILD=$(find dist-newstyle \( -name 'hls' -o -name 'hls.exe' \) -type f)
73-
HLS=haskell-language-server-$GHC_VER
79+
HLS=haskell-language-server-${{env.GHC_VERSION}}
7480
mv $HLS_BUILD $HLS${{env.EXE_EXT}}
7581
if [[ "$OSTYPE" == "msys" ]]; then
7682
7z a $HLS.zip $HLS${{env.EXE_EXT}}
@@ -91,7 +97,7 @@ jobs:
9197
with:
9298
upload_url: ${{ github.event.release.upload_url }}
9399
asset_path: ${{ steps.compress_server_binary.outputs.path }}
94-
asset_name: haskell-language-server-${{ runner.OS }}-${{ matrix.ghc }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }}
100+
asset_name: haskell-language-server-${{ runner.OS }}-${{ env.GHC_VERSION }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }}
95101
asset_content_type: ${{ steps.compress_server_binary.outputs.content_type }}
96102

97103
- uses: actions/upload-artifact@v2

exe/Main.hs

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,14 @@
11
-- Copyright (c) 2019 The DAML Authors. All rights reserved.
22
-- SPDX-License-Identifier: Apache-2.0
3-
{-# LANGUAGE CPP #-}
43
{-# LANGUAGE OverloadedStrings #-}
54
{-# LANGUAGE RecordWildCards #-}
65
module Main(main) where
76

87
import Ide.Arguments (Arguments (..), LspArguments (..),
98
getArguments)
109
import Ide.Main (defaultMain)
11-
import Ide.Types (IdePlugins)
10+
import Plugins
1211

13-
-- haskell-language-server plugins
14-
15-
import Ide.Plugin.Eval as Eval
16-
import Ide.Plugin.Example as Example
17-
import Ide.Plugin.Example2 as Example2
18-
import Ide.Plugin.Floskell as Floskell
19-
import Ide.Plugin.Fourmolu as Fourmolu
20-
import Ide.Plugin.GhcIde as GhcIde
21-
import Ide.Plugin.ExplicitImports as ExplicitImports
22-
import Ide.Plugin.Ormolu as Ormolu
23-
import Ide.Plugin.Retrie as Retrie
24-
import Ide.Plugin.StylishHaskell as StylishHaskell
25-
import Ide.Plugin.Tactic as Tactic
26-
import Ide.Plugin.Hlint as Hlint
27-
import Ide.Plugin.HaddockComments as HaddockComments
28-
#if AGPL
29-
import Ide.Plugin.Brittany as Brittany
30-
#endif
31-
import Ide.Plugin (pluginDescToIdePlugins)
32-
import Ide.Plugin.ModuleName as ModuleName
33-
import Ide.Plugin.Pragmas as Pragmas
34-
35-
36-
-- ---------------------------------------------------------------------
37-
38-
-- | The plugins configured for use in this instance of the language
39-
-- server.
40-
-- These can be freely added or removed to tailor the available
41-
-- features of the server.
42-
43-
idePlugins :: Bool -> IdePlugins
44-
idePlugins includeExamples = pluginDescToIdePlugins allPlugins
45-
where
46-
allPlugins = if includeExamples
47-
then basePlugins ++ examplePlugins
48-
else basePlugins
49-
basePlugins =
50-
[ GhcIde.descriptor "ghcide"
51-
, Pragmas.descriptor "pragmas"
52-
, Floskell.descriptor "floskell"
53-
, Fourmolu.descriptor "fourmolu"
54-
, Tactic.descriptor "tactic"
55-
-- , genericDescriptor "generic"
56-
-- , ghcmodDescriptor "ghcmod"
57-
, Ormolu.descriptor "ormolu"
58-
, StylishHaskell.descriptor "stylish-haskell"
59-
, Retrie.descriptor "retrie"
60-
#if AGPL
61-
, Brittany.descriptor "brittany"
62-
#endif
63-
, Eval.descriptor "eval"
64-
, ExplicitImports.descriptor "importLens"
65-
, ModuleName.descriptor "moduleName"
66-
, Hlint.descriptor "hlint"
67-
, HaddockComments.descriptor "haddockComments"
68-
]
69-
examplePlugins =
70-
[Example.descriptor "eg"
71-
,Example2.descriptor "eg2"
72-
]
73-
74-
-- ---------------------------------------------------------------------
7512

7613
main :: IO ()
7714
main = do

exe/Plugins.hs

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
{-# LANGUAGE CPP #-}
2+
{-# LANGUAGE OverloadedStrings #-}
3+
module Plugins where
4+
5+
import Ide.Types (IdePlugins)
6+
import Ide.Plugin (pluginDescToIdePlugins)
7+
8+
-- fixed plugins
9+
import Ide.Plugin.Example as Example
10+
import Ide.Plugin.Example2 as Example2
11+
import Ide.Plugin.GhcIde as GhcIde
12+
13+
-- haskell-language-server optional plugins
14+
15+
#if eval
16+
import Ide.Plugin.Eval as Eval
17+
#endif
18+
19+
#if importLens
20+
import Ide.Plugin.ExplicitImports as ExplicitImports
21+
#endif
22+
23+
#if retrie
24+
import Ide.Plugin.Retrie as Retrie
25+
#endif
26+
27+
#if tactic
28+
import Ide.Plugin.Tactic as Tactic
29+
#endif
30+
31+
#if hlint
32+
import Ide.Plugin.Hlint as Hlint
33+
#endif
34+
35+
#if moduleName
36+
import Ide.Plugin.ModuleName as ModuleName
37+
#endif
38+
39+
#if pragmas
40+
import Ide.Plugin.Pragmas as Pragmas
41+
#endif
42+
43+
#if haddockComments
44+
import Ide.Plugin.HaddockComments as HaddockComments
45+
#endif
46+
47+
-- formatters
48+
49+
#if floskell
50+
import Ide.Plugin.Floskell as Floskell
51+
#endif
52+
53+
#if fourmolu
54+
import Ide.Plugin.Fourmolu as Fourmolu
55+
#endif
56+
57+
#if ormolu
58+
import Ide.Plugin.Ormolu as Ormolu
59+
#endif
60+
61+
#if stylishHaskell
62+
import Ide.Plugin.StylishHaskell as StylishHaskell
63+
#endif
64+
65+
#if AGPL && brittany
66+
import Ide.Plugin.Brittany as Brittany
67+
#endif
68+
69+
-- ---------------------------------------------------------------------
70+
71+
-- | The plugins configured for use in this instance of the language
72+
-- server.
73+
-- These can be freely added or removed to tailor the available
74+
-- features of the server.
75+
76+
idePlugins :: Bool -> IdePlugins
77+
idePlugins includeExamples = pluginDescToIdePlugins allPlugins
78+
where
79+
allPlugins = if includeExamples
80+
then basePlugins ++ examplePlugins
81+
else basePlugins
82+
basePlugins =
83+
[ GhcIde.descriptor "ghcide"
84+
#if pragmas
85+
, Pragmas.descriptor "pragmas"
86+
#endif
87+
#if haddockComments
88+
, HaddockComments.descriptor "haddockComments"
89+
#endif
90+
#if floskell
91+
, Floskell.descriptor "floskell"
92+
#endif
93+
#if fourmolu
94+
, Fourmolu.descriptor "fourmolu"
95+
#endif
96+
#if tactic
97+
, Tactic.descriptor "tactic"
98+
#endif
99+
#if ormolu
100+
, Ormolu.descriptor "ormolu"
101+
#endif
102+
#if stylishHaskell
103+
, StylishHaskell.descriptor "stylish-haskell"
104+
#endif
105+
#if retrie
106+
, Retrie.descriptor "retrie"
107+
#endif
108+
#if AGPL && brittany
109+
, Brittany.descriptor "brittany"
110+
#endif
111+
#if eval
112+
, Eval.descriptor "eval"
113+
#endif
114+
#if importLens
115+
, ExplicitImports.descriptor "importLens"
116+
#endif
117+
#if moduleName
118+
, ModuleName.descriptor "moduleName"
119+
#endif
120+
#if hlint
121+
, Hlint.descriptor "hlint"
122+
#endif
123+
]
124+
examplePlugins =
125+
[Example.descriptor "eg"
126+
,Example2.descriptor "eg2"
127+
]

0 commit comments

Comments
 (0)