Skip to content

Commit

Permalink
Merge pull request #31 from alanz/rename-to-haskell-language-server
Browse files Browse the repository at this point in the history
Rename to haskell-language-server
  • Loading branch information
alanz authored Feb 1, 2020
2 parents a8b931d + d85938f commit a5df8b3
Show file tree
Hide file tree
Showing 19 changed files with 94 additions and 78 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# ide
# haskell-language-server

[![License Apache 2.0][badge-license]][license]
[![CircleCI][badge-circleci]][circleci]

[badge-license]: https://img.shields.io/badge/license-Apache2-green.svg?dummy
[license]: /~https://github.com/haskell/ide/blob/master/LICENSE
[badge-circleci]: https://img.shields.io/circleci/project/github/haskell/ide/master.svg
[circleci]: https://circleci.com/gh/haskell/ide/
[license]: /~https://github.com/haskell/haskell-language-server/blob/master/LICENSE
[badge-circleci]: https://img.shields.io/circleci/project/github/haskell/haskell-language-server/master.svg
[circleci]: https://circleci.com/gh/haskell/haskell-language-server/

Integration point for ghcide and haskell-ide-engine. One IDE to rule them all. Read the [project's background](https://neilmitchell.blogspot.com/2020/01/one-haskell-ide-to-rule-them-all.html).
Integration point for ghcide and haskell-ide-engine. One IDE to rule
them all. Read the [project's
background](https://neilmitchell.blogspot.com/2020/01/one-haskell-ide-to-rule-them-all.html).

This is *very* early stage software.

Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 6 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ packages:

tests: true

package ide
package haskell-language-server
test-show-details: direct
package ghcide
test-show-details: direct

write-ghc-environment-files: never

-- pre-brexit
-- A later version (2020-02-01T08:48:32Z) has a problem with a diamond
-- dependency for cabal-helper and cabal-plan
index-state: 2020-01-31T22:59:59Z
4 changes: 2 additions & 2 deletions exe/Arguments.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Data.Version
import Development.GitRev
import qualified GHC.Paths
import Options.Applicative
import Paths_ide
import Paths_haskell_language_server
import System.Environment

-- ---------------------------------------------------------------------
Expand All @@ -38,7 +38,7 @@ getArguments exeName = execParser opts
where
opts = info (arguments exeName <**> helper)
( fullDesc
<> progDesc "Used as a test bed to check your IDE will work"
<> progDesc "Used as a test bed to check your IDE Client will work"
<> header (exeName ++ " - GHC Haskell LSP server"))

arguments :: String -> Parser Arguments
Expand Down
8 changes: 4 additions & 4 deletions exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ main :: IO ()
main = do
-- WARNING: If you write to stdout before runLanguageServer
-- then the language server will not work
Arguments{..} <- getArguments "haskell-ide"
Arguments{..} <- getArguments "haskell-language-server"

if argsVersion then ghcideVersion >>= putStrLn >> exitSuccess
else hPutStrLn stderr {- see WARNING above -} =<< ghcideVersion
Expand All @@ -83,7 +83,7 @@ main = do

if argLSP then do
t <- offsetTime
hPutStrLn stderr "Starting (ide)LSP server..."
hPutStrLn stderr "Starting (haskell-language-server)LSP server..."
hPutStrLn stderr "If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option!"
runLanguageServer def (pluginHandler plugins) $ \getLspId event vfs caps -> do
t <- t
Expand All @@ -96,8 +96,8 @@ main = do
}
initialise caps (mainRule >> pluginRules plugins >> action kick) getLspId event (logger minBound) options vfs
else do
putStrLn $ "Ghcide setup tester in " ++ dir ++ "."
putStrLn "Report bugs at /~https://github.com/digital-asset/ghcide/issues"
putStrLn $ "(haskell-language-server)Ghcide setup tester in " ++ dir ++ "."
putStrLn "Report bugs at /~https://github.com/haskell/haskell-language-server/issues"

putStrLn $ "\nStep 1/6: Finding files to test in " ++ dir
files <- nubOrd <$> expandFiles (argFiles ++ ["." | null argFiles])
Expand Down
19 changes: 10 additions & 9 deletions exe/Wrapper.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ main :: IO ()
main = do
-- WARNING: If you write to stdout before runLanguageServer
-- then the language server will not work
Arguments{..} <- getArguments "haskell-ide"
Arguments{..} <- getArguments "haskell-language-server-wrapper"

if argsVersion then ghcideVersion >>= putStrLn >> exitSuccess
else hPutStrLn stderr {- see WARNING above -} =<< ghcideVersion
Expand All @@ -55,7 +55,8 @@ main = do
-- Core.setupLogger mLogFileName ["hie"] logLevel

progName <- getProgName
logm $ "run entered for haskell-ide-wrapper(" ++ progName ++ ") " ++ hieVersion
logm $ "run entered for haskell-language-server-wrapper(" ++ progName ++ ") "
++ hieVersion
d <- getCurrentDirectory
logm $ "Current directory:" ++ d
logm $ "Operating system:" ++ os
Expand All @@ -72,22 +73,22 @@ main = do
logm $ "Project GHC version:" ++ ghcVersion

let
hieBin = "haskell-ide-" ++ ghcVersion
hieBin = "haskell-language-server-" ++ ghcVersion
backupHieBin =
case dropWhileEnd (/='.') ghcVersion of
[] -> "haskell-ide"
xs -> "haskell-ide-" ++ init xs
candidates' = [hieBin, backupHieBin, "haskell-ide"]
[] -> "haskell-language-server"
xs -> "haskell-language-server-" ++ init xs
candidates' = [hieBin, backupHieBin, "haskell-language-server"]
candidates = map (++ exeExtension) candidates'

logm $ "haskell-ide exe candidates :" ++ show candidates
logm $ "haskell-language-server exe candidates :" ++ show candidates

mexes <- traverse findExecutable candidates

case asum mexes of
Nothing -> logm $ "cannot find any haskell-ide exe, looked for:" ++ intercalate ", " candidates
Nothing -> logm $ "cannot find any haskell-language-server exe, looked for:" ++ intercalate ", " candidates
Just e -> do
logm $ "found haskell-ide exe at:" ++ e
logm $ "found haskell-language-server exe at:" ++ e
logm $ "args:" ++ show args
logm "launching ....\n\n\n"
callProcess e args
Expand Down
33 changes: 16 additions & 17 deletions ide.cabal → haskell-language-server.cabal
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cabal-version: 1.12
category: Development
name: ide
name: haskell-language-server
version: 0.1.0.0
synopsis: LSP server for GHC
description: Please see the README on GitHub at </~https://github.com/alanz/ide#readme>
homepage: /~https://github.com/alanz/ide#readme
bug-reports: /~https://github.com/alanz/ide/issues
description: Please see the README on GitHub at </~https://github.com/haskell/haskell-language-server#readme>
homepage: /~https://github.com/haskell/haskell-language-server#readme
bug-reports: /~https://github.com/haskell/haskell-language-server/issues
author: Alan Zimmerman
maintainer: alan.zimm@gmail.com
copyright: Alan Zimmerman
Expand All @@ -16,23 +16,22 @@ 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/alanz/ide
location: /~https://github.com/haskell/haskell-language-server

library
exposed-modules:
Ide.Cradle
Ide.Plugin.Example
Ide.Version
other-modules:
Paths_ide
Paths_haskell_language_server
hs-source-dirs:
src
build-depends:
Expand Down Expand Up @@ -87,15 +86,15 @@ library

default-language: Haskell2010

executable haskell-ide
executable haskell-language-server
main-is: Main.hs
hs-source-dirs:
exe
other-modules:
Arguments
Paths_ide
Paths_haskell_language_server
autogen-modules:
Paths_ide
Paths_haskell_language_server
ghc-options:
-threaded
-Wall
Expand Down Expand Up @@ -124,21 +123,21 @@ executable haskell-ide
, haskell-lsp
, hie-bios >= 0.3.2 && < 0.4
, hslogger
, ide
, haskell-language-server
, optparse-applicative
, shake >= 0.17.5
, text
default-language: Haskell2010

executable haskell-ide-wrapper
executable haskell-language-server-wrapper
main-is: Wrapper.hs
hs-source-dirs:
exe
other-modules:
Arguments
Paths_ide
Paths_haskell_language_server
autogen-modules:
Paths_ide
Paths_haskell_language_server
ghc-options:
-threaded
-Wall
Expand All @@ -163,7 +162,7 @@ executable haskell-ide-wrapper
, ghc-paths
, haskell-lsp
, hie-bios
, ide
, haskell-language-server
, optparse-applicative
, process
, text
Expand All @@ -174,7 +173,7 @@ test-suite test
type: exitcode-stdio-1.0
main-is: Spec.hs
other-modules:
Paths_ide
Paths_haskell_language_server
hs-source-dirs:
test
ghc-options:
Expand All @@ -186,5 +185,5 @@ test-suite test
ghc-options: -Werror
build-depends:
base >=4.7 && <5
, ide
, haskell-language-server
default-language: Haskell2010
14 changes: 7 additions & 7 deletions hie.yaml.cbl
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# This is a sample hie.yaml file for opening haskell-ide-engine in
# hie, using cabal as the build system.
# To use is, copy it to a file called 'hie.yaml'
# This is a sample hie.yaml file for opening haskell-language-server
# in hie, using cabal as the build system. To use is, copy it to a
# file called 'hie.yaml'

cradle:
cabal:

- path: "./test"
component: "ide:test"
component: "haskell-language-server:test"

- path: "./exe/Main.hs"
component: "ide:exe:haskell-ide"
component: "haskell-language-server:exe:haskell-language-server"

- path: "./exe/Wrapper.hs"
component: "ide:exe:haskell-ide-wrapper"
component: "haskell-language-server:exe:haskell-language-server-wrapper"

- path: "./src"
component: "lib:ide"
component: "lib:haskell-language-server"

- path: "./ghcide/src"
component: "ghcide:lib:ghcide"
Expand Down
23 changes: 16 additions & 7 deletions hie.yaml.stack
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# This is a sample hie.yaml file for opening haskell-ide-engine in
# hie, using stack as the build system.
# To use is, copy it to a file called 'hie.yaml'
# This is a sample hie.yaml file for opening haskell-language-server
# in hie, using stack as the build system. To use is, copy it to a
# file called 'hie.yaml'

cradle:
stack:
- path: "./test"
component: "ide:test"
component: "haskell-language-server:test"

- path: "./exe"
component: "ide:exe:ide"
- path: "./exe/Main.hs"
component: "haskell-language-server:exe:haskell-language-server"

- path: "./exe/Wrapper.hs"
component: "haskell-language-server:exe:haskell-language-server-wrapper"

- path: "./src"
component: "ide:lib"
component: "haskell-language-server:lib"

- path: "./ghcide/src"
component: "ghcide:lib:ghcide"

- path: "./ghcide/exe"
component: "ghcide:exe:ghcide"
14 changes: 7 additions & 7 deletions install/src/Cabal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ cabalInstallHie versionNumber = do
, "--write-ghc-environment-files=never"
, installDirOpt, localBin
, "--max-backjumps=5000"
, "exe:haskell-ide"
, "exe:haskell-language-server"
, "--overwrite-policy=always"
]
++ installMethod

let minorVerExe = "haskell-ide-" ++ versionNumber <.> exe
majorVerExe = "haskell-ide-" ++ dropExtension versionNumber <.> exe
let minorVerExe = "haskell-language-server-" ++ versionNumber <.> exe
majorVerExe = "haskell-language-server-" ++ dropExtension versionNumber <.> exe

liftIO $ do
copyFile (localBin </> "haskell-ide" <.> exe) (localBin </> minorVerExe)
copyFile (localBin </> "haskell-ide" <.> exe) (localBin </> majorVerExe)
copyFile (localBin </> "haskell-language-server" <.> exe) (localBin </> minorVerExe)
copyFile (localBin </> "haskell-language-server" <.> exe) (localBin </> majorVerExe)

printLine $ "Copied executables "
++ ("haskell-ide-wrapper" <.> exe) ++ ", "
++ ("haskell-ide" <.> exe) ++ ", "
++ ("haskell-language-server-wrapper" <.> exe) ++ ", "
++ ("haskell-language-server" <.> exe) ++ ", "
++ majorVerExe ++ " and "
++ minorVerExe
++ " to " ++ localBin
Expand Down
12 changes: 6 additions & 6 deletions install/src/Help.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ shortHelpMessage = do
, cabalGhcsTarget
]

-- | A record that specifies for each build system which versions of @haskell-ide@ can be built.
-- | A record that specifies for each build system which versions of @haskell-language-server@ can be built.
data BuildableVersions = BuildableVersions
{ stackVersions :: [VersionNumber]
, cabalVersions :: [VersionNumber]
Expand Down Expand Up @@ -97,17 +97,17 @@ templateTarget = ("<target>", "")

hieTarget :: String -> TargetDescription
hieTarget version =
("haskell-ide-" ++ version, "Install haskell-ide for GHC version " ++ version)
("haskell-language-server-" ++ version, "Install haskell-language-server for GHC version " ++ version)

buildTarget :: TargetDescription
buildTarget = ("haskell-ide", "Install haskell-ide with the latest available GHC and the data files")
buildTarget = ("haskell-language-server", "Install haskell-language-server with the latest available GHC and the data files")

buildLatestTarget :: TargetDescription
buildLatestTarget = ("latest", "Install haskell-ide with the latest available GHC")
buildLatestTarget = ("latest", "Install haskell-language-server with the latest available GHC")

buildDataTarget :: TargetDescription
buildDataTarget =
("data", "Get the required data-files for `haskell-ide` (Hoogle DB)")
("data", "Get the required data-files for `haskell-language-server` (Hoogle DB)")

-- special targets

Expand All @@ -124,4 +124,4 @@ cabalGhcsTarget =
)

stackDevTarget :: TargetDescription
stackDevTarget = ("dev", "Install haskell-ide with the default stack.yaml")
stackDevTarget = ("dev", "Install haskell-language-server with the default stack.yaml")
6 changes: 3 additions & 3 deletions install/src/HieInstall.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ defaultMain = do

forM_
versions
(\version -> phony ("haskell-ide-" ++ version) $ do
(\version -> phony ("haskell-language-server-" ++ version) $ do
need ["submodules"]
need ["check"]
if isRunFromStack then do
Expand All @@ -84,8 +84,8 @@ defaultMain = do
cabalInstallHie version
)

phony "latest" (need ["haskell-ide-" ++ latestVersion])
phony "haskell-ide" (need ["data", "latest"])
phony "latest" (need ["haskell-language-server-" ++ latestVersion])
phony "haskell-language-server" (need ["data", "latest"])

-- stack specific targets
when isRunFromStack $ do
Expand Down
Loading

0 comments on commit a5df8b3

Please sign in to comment.