Skip to content

Commit 7d42115

Browse files
jneirafendor
authored andcommitted
Complete renaming from hie to hls
1 parent baec2f5 commit 7d42115

File tree

9 files changed

+43
-45
lines changed

9 files changed

+43
-45
lines changed

install.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
{- stack
33
runghc
44
--stack-yaml=install/shake.yaml
5-
--package hie-install
5+
--package hls-install
66
-}
77
{- cabal:
88
build-depends:
99
base
10-
, hie-install
10+
, hls-install
1111
-}
1212
-- call as:
1313
-- * `cabal v2-run install.hs --project-file install/shake.project <target>`
@@ -16,6 +16,6 @@ build-depends:
1616
-- TODO: set `shake.project` in cabal-config above, when supported
1717
-- (see https://github.com/haskell/cabal/issues/6353)
1818

19-
import HieInstall (defaultMain)
19+
import HlsInstall (defaultMain)
2020

2121
main = defaultMain

install/Setup.hs

Lines changed: 0 additions & 2 deletions
This file was deleted.

install/hie-install.cabal renamed to install/hls-install.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: hie-install
1+
name: hls-install
22
version: 0.8.0.0
3-
synopsis: Install the haskell-ide-engine
3+
synopsis: Install the haskell-language-engine
44
license: BSD3
55
author: Many, TBD when we release
66
maintainer: [email protected]
@@ -10,7 +10,7 @@ cabal-version: >=2.0
1010

1111
library
1212
hs-source-dirs: src
13-
exposed-modules: HieInstall
13+
exposed-modules: HlsInstall
1414
other-modules: BuildSystem
1515
, Stack
1616
, Version

install/shake.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ nix:
77
packages: [ zlib ]
88

99
flags:
10-
hie-install:
10+
hls-install:
1111
run-from-stack: true

install/src/Cabal.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ getGhcPathOfOrThrowError versionNumber =
4343
error (ghcVersionNotFoundFailMsg versionNumber)
4444
Just p -> return p
4545

46-
cabalInstallHie :: VersionNumber -> [String] -> Action ()
47-
cabalInstallHie versionNumber args = do
46+
cabalInstallHls :: VersionNumber -> [String] -> Action ()
47+
cabalInstallHls versionNumber args = do
4848
localBin <- liftIO $ getInstallDir
4949
cabalVersion <- getCabalVersion args
5050
ghcPath <- getGhcPathOfOrThrowError versionNumber

install/src/Env.hs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ isWindowsSystem = os `elem` ["mingw32", "win32"]
4141

4242
findInstalledGhcs :: IO [(VersionNumber, GhcPath)]
4343
findInstalledGhcs = do
44-
hieVersions <- getHieVersions :: IO [VersionNumber]
44+
hlsVersions <- getHlsVersions :: IO [VersionNumber]
4545
knownGhcs <- mapMaybeM
4646
(\version -> getGhcPathOf version >>= \case
4747
Nothing -> return Nothing
4848
Just p -> return $ Just (version, p)
4949
)
50-
(reverse hieVersions)
50+
(reverse hlsVersions)
5151
-- filter out not supported ghc versions
52-
availableGhcs <- filter ((`elem` hieVersions) . fst) <$> getGhcPaths
52+
availableGhcs <- filter ((`elem` hlsVersions) . fst) <$> getGhcPaths
5353
return
54-
-- sort by version to make it coherent with getHieVersions
54+
-- sort by version to make it coherent with getHlsVersions
5555
$ sortBy (comparing fst)
5656
-- nub by version. knownGhcs takes precedence.
5757
$ nubBy ((==) `on` fst)
@@ -103,15 +103,15 @@ ghcVersionNotFoundFailMsg versionNumber =
103103
<> "Either install a fitting GHC, use the stack targets or modify the PATH variable accordingly."
104104

105105

106-
-- | Defines all different hie versions that are buildable.
106+
-- | Defines all different hls versions that are buildable.
107107
--
108108
-- The current directory is scanned for `stack-*.yaml` files.
109-
getHieVersions :: MonadIO m => m [VersionNumber]
110-
getHieVersions = do
109+
getHlsVersions :: MonadIO m => m [VersionNumber]
110+
getHlsVersions = do
111111
let stackYamlPrefix = T.pack "stack-"
112112
let stackYamlSuffix = T.pack ".yaml"
113113
files <- liftIO $ listDirectory "."
114-
let hieVersions =
114+
let hlsVersions =
115115
files
116116
& map T.pack
117117
& mapMaybe
@@ -120,10 +120,10 @@ getHieVersions = do
120120
-- the following line excludes `8.6.3`, `8.8.1` and `8.8.2` on windows systems
121121
& filter (\p -> not (isWindowsSystem && p `elem` ["8.6.3", "8.8.1", "8.8.2"]))
122122
& sort
123-
return hieVersions
123+
return hlsVersions
124124

125125

126-
-- | Most recent version of hie.
126+
-- | Most recent version of hls.
127127
-- Shown in the more concise help message.
128-
mostRecentHieVersion :: MonadIO m => m VersionNumber
129-
mostRecentHieVersion = last <$> getHieVersions
128+
mostRecentHlsVersion :: MonadIO m => m VersionNumber
129+
mostRecentHlsVersion = last <$> getHlsVersions

install/src/Help.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ printUsage = do
3030
-- | short help message is printed by default
3131
shortHelpMessage :: Action ()
3232
shortHelpMessage = do
33-
hieVersions <- getHieVersions
33+
hlsVersions <- getHlsVersions
3434
printUsage
3535
printLine ""
3636
printLine "Targets:"
37-
mapM_ (printLineIndented . showHelpItem (spaces hieVersions)) (targets hieVersions)
37+
mapM_ (printLineIndented . showHelpItem (spaces hlsVersions)) (targets hlsVersions)
3838
printLine ""
3939
where
40-
spaces hieVersions = space (targets hieVersions)
41-
targets hieVersions =
40+
spaces hlsVersions = space (targets hlsVersions)
41+
targets hlsVersions =
4242
[ ("help", "Show help message including all targets")
4343
, emptyTarget
4444
, buildTarget
4545
, buildLatestTarget
46-
, hieTarget $ last hieVersions
46+
, hlsTarget $ last hlsVersions
4747
, buildDataTarget
4848
, cabalGhcsTarget
4949
]
@@ -90,7 +90,7 @@ helpMessage versions@BuildableVersions {..} = do
9090
generalTargets = [helpTarget]
9191

9292
defaultTargets = [buildTarget, buildLatestTarget, buildDataTarget]
93-
++ map hieTarget (getDefaultBuildSystemVersions versions)
93+
++ map hlsTarget (getDefaultBuildSystemVersions versions)
9494

9595
-- | Empty target. Purpose is to introduce a newline between the targets
9696
emptyTarget :: (String, String)
@@ -99,8 +99,8 @@ emptyTarget = ("", "")
9999
templateTarget :: (String, String)
100100
templateTarget = ("<target>", "")
101101

102-
hieTarget :: String -> TargetDescription
103-
hieTarget version =
102+
hlsTarget :: String -> TargetDescription
103+
hlsTarget version =
104104
("hls-" ++ version, "Install haskell-language-server for GHC version " ++ version)
105105

106106
buildTarget :: TargetDescription

install/src/HieInstall.hs renamed to install/src/HlsInstall.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module HieInstall where
1+
module HlsInstall where
22

33
import Development.Shake
44
import Control.Monad
@@ -21,7 +21,7 @@ defaultMain = do
2121
let cabalVersions = map fst ghcPaths
2222

2323
-- used for stack-based targets
24-
stackVersions <- getHieVersions
24+
stackVersions <- getHlsVersions
2525

2626
let versions = if isRunFromStack then stackVersions else cabalVersions
2727

@@ -62,22 +62,22 @@ defaultMain = do
6262
need ["submodules"]
6363
need ["check"]
6464
if isRunFromStack then
65-
stackInstallHieWithErrMsg (Just version) args
65+
stackInstallHlsWithErrMsg (Just version) args
6666
else
67-
cabalInstallHie version args
67+
cabalInstallHls version args
6868
)
6969

7070
unless (null versions) $ do
7171
phony "latest" (need ["hls-" ++ latestVersion])
7272
phony "hls" (need ["data", "latest"])
7373

7474
-- stack specific targets
75-
-- Default `stack.yaml` uses ghc-8.8.2 and we can't build hie in windows
75+
-- Default `stack.yaml` uses ghc-8.8.2 and we can't build hls in windows
7676
-- TODO: Enable for windows when it uses ghc-8.8.3
7777
when (isRunFromStack && not isWindowsSystem) $
7878
phony "dev" $ do
7979
need ["show-options"]
80-
stackInstallHieWithErrMsg Nothing args
80+
stackInstallHlsWithErrMsg Nothing args
8181

8282
-- cabal specific targets
8383
when isRunFromCabal $ do

install/src/Stack.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import System.Directory ( copyFile )
99
import Version
1010
import Print
1111

12-
stackInstallHieWithErrMsg :: Maybe VersionNumber -> [String] -> Action ()
13-
stackInstallHieWithErrMsg mbVersionNumber args =
14-
stackInstallHie mbVersionNumber args
12+
stackInstallHlsWithErrMsg :: Maybe VersionNumber -> [String] -> Action ()
13+
stackInstallHlsWithErrMsg mbVersionNumber args =
14+
stackInstallHls mbVersionNumber args
1515
`actionOnException` liftIO (putStrLn stackBuildFailMsg)
1616

1717
-- | copy the built binaries into the localBinDir
18-
stackInstallHie :: Maybe VersionNumber -> [String] -> Action ()
19-
stackInstallHie mbVersionNumber args = do
18+
stackInstallHls :: Maybe VersionNumber -> [String] -> Action ()
19+
stackInstallHls mbVersionNumber args = do
2020
versionNumber <-
2121
case mbVersionNumber of
2222
Nothing -> do
@@ -30,11 +30,11 @@ stackInstallHie mbVersionNumber args = do
3030
return vn
3131

3232
localBinDir <- getLocalBin args
33-
let hie = "haskell-language-server" <.> exe
33+
let hls = "haskell-language-server" <.> exe
3434
liftIO $ do
35-
copyFile (localBinDir </> hie)
35+
copyFile (localBinDir </> hls)
3636
(localBinDir </> "haskell-language-server-" ++ versionNumber <.> exe)
37-
copyFile (localBinDir </> hie)
37+
copyFile (localBinDir </> hls)
3838
(localBinDir </> "haskell-language-server-" ++ dropExtension versionNumber <.> exe)
3939

4040
getGhcVersionOfCfgFile :: String -> [String] -> Action VersionNumber

0 commit comments

Comments
 (0)