Skip to content

Commit 5da86c3

Browse files
cocreaturegaryverhaegen-da
authored andcommitted
Rename hie-core to ghcide (#2820)
* Rename hie-core to ghcide The name `hie-core` has caused a lot of confusion as to how we relate to haskell-ide-engine so changing it should hopefully help with that. I also think that ghcide is still a good name once we hopefully integrate with haskell-ide-engine more closely. The name ghcide seems to have a reasonable amount of support on Twitter https://twitter.com/ndm_haskell/status/1170681262987710464 which is of course the only good way to come up with names. * Add a readme that points people to the new directory. * Fix bogus replacements * Use a proper link * links are hard
1 parent 5ac4265 commit 5da86c3

File tree

16 files changed

+58
-79
lines changed

16 files changed

+58
-79
lines changed

.ghci

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

BUILD.bazel

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ hidden = [
6060
]
6161

6262
da_haskell_library(
63-
name = "hie-core",
63+
name = "ghcide",
6464
srcs = glob(["src/**/*.hs"]),
6565
hackage_deps = depends + [
6666
"ghc-lib",
@@ -83,7 +83,7 @@ cc_library(
8383
) if not is_windows else None
8484

8585
da_haskell_library(
86-
name = "hie-core-public",
86+
name = "ghcide-public",
8787
srcs = glob(["src/**/*.hs"]),
8888
compiler_flags = ["-DGHC_STABLE"],
8989
hackage_deps = depends + [
@@ -104,7 +104,7 @@ da_haskell_library(
104104
)
105105

106106
da_haskell_binary(
107-
name = "hie-core-exe",
107+
name = "ghcide-exe",
108108
srcs = glob(["exe/**/*.hs"]),
109109
hackage_deps = [
110110
"base",
@@ -124,6 +124,6 @@ da_haskell_binary(
124124
src_strip_prefix = "test",
125125
visibility = ["//visibility:public"],
126126
deps = [
127-
"hie-core-public",
127+
"ghcide-public",
128128
],
129129
)

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# `hie-core` (Haskell IDE engine)
1+
# `ghcide`
22

33
Our vision is that you should build an IDE by combining:
44

55

66
<img style="float:right;" src="img/vscode2.png"/>
77

88
* [`hie-bios`](https://github.com/mpickering/hie-bios) for determining where your files are, what are their dependencies, what extensions are enabled and so on;
9-
* `hie-core` (i.e. this library) for defining how to type check, when to type check, and producing diagnostic messages;
9+
* `ghcide` (i.e. this library) for defining how to type check, when to type check, and producing diagnostic messages;
1010
* A bunch of plugins that haven't yet been written, e.g. [`hie-hlint`](https://github.com/ndmitchell/hlint) and [`hie-ormolu`](https://github.com/tweag/ormolu), to choose which features you want;
1111
* [`haskell-lsp`](https://github.com/alanz/haskell-lsp) for sending those messages to a [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/) server;
1212
* An extension for your editor. We provide a [VS Code extension](https://code.visualstudio.com/api) as `extension` in this directory, although the components work in other LSP editors too (see below for instructions using Emacs).
@@ -15,25 +15,25 @@ There are more details about our approach [in this blog post](https://4ta.uk/p/s
1515

1616
## Using it
1717

18-
### Install `hie-core`
18+
### Install `ghcide`
1919

2020
#### With Nix
2121

2222
[See hie-core-nix repository](https://github.com/hercules-ci/hie-core-nix)
2323

2424
#### With Cabal or Stack
2525

26-
First install the `hie-core` binary using `stack` or `cabal`, e.g.
26+
First install the `ghcide` binary using `stack` or `cabal`, e.g.
2727

2828
1. `git clone https://github.com/digital-asset/daml.git`
29-
2. `cd daml/compiler/hie-core`
29+
2. `cd daml/compiler/ghcide`
3030
3. `cabal install` or `stack install` (and make sure `~/.local/bin` is on your `$PATH`)
3131

32-
It's important that `hie-core` is compiled with the same compiler you use to build your projects.
32+
It's important that `ghcide` is compiled with the same compiler you use to build your projects.
3333

34-
### Test `hie-core`
34+
### Test `ghcide`
3535

36-
Next, check that `hie-core` is capable of loading your code. Change to the project directory and run `hie-core`, which will try and load everything using the same code as the IDE, but in a way that's much easier to understand. For example, taking the example of [`shake`](https://github.com/ndmitchell/shake), running `hie-core` gives some error messages and warnings before reporting at the end:
36+
Next, check that `ghcide` is capable of loading your code. Change to the project directory and run `ghcide`, which will try and load everything using the same code as the IDE, but in a way that's much easier to understand. For example, taking the example of [`shake`](https://github.com/ndmitchell/shake), running `ghcide` gives some error messages and warnings before reporting at the end:
3737

3838
```
3939
Files that worked: 152
@@ -49,21 +49,21 @@ Done
4949

5050
Of the 158 files in Shake, as of this moment, 152 can be loaded by the IDE, but 6 can't (error messages for the reasons they can't be loaded are given earlier). The failing files are all prototype work or test output, meaning I can confidently use Shake.
5151

52-
The `hie-core` executable mostly relies on [`hie-bios`](https://github.com/mpickering/hie-bios) to do the difficult work of setting up your GHC environment. If it doesn't work, see [the `hie-bios` manual](https://github.com/mpickering/hie-bios#readme) to get it working. My default fallback is to figure it out by hand and create a `direct` style [`hie.yaml`](https://github.com/ndmitchell/shake/blob/master/hie.yaml) listing the command line arguments to load the project.
52+
The `ghcide` executable mostly relies on [`hie-bios`](https://github.com/mpickering/hie-bios) to do the difficult work of setting up your GHC environment. If it doesn't work, see [the `hie-bios` manual](https://github.com/mpickering/hie-bios#readme) to get it working. My default fallback is to figure it out by hand and create a `direct` style [`hie.yaml`](https://github.com/ndmitchell/shake/blob/master/hie.yaml) listing the command line arguments to load the project.
5353

54-
Once you have got `hie-core` working outside the editor, the next step is to pick which editor to integrate with.
54+
Once you have got `ghcide` working outside the editor, the next step is to pick which editor to integrate with.
5555

5656
### Using with VS Code
5757

5858
Install the VS code extension (see https://code.visualstudio.com/docs/setup/mac for details on adding `code` to your `$PATH`):
5959

60-
1. `cd compiler/hie-core/extension`
60+
1. `cd compiler/ghcide/extension`
6161
2. `npm ci`
6262
3. `npm install vsce --global` (may require `sudo`)
6363
4. `vsce package`
64-
5. `code --install-extension hie-core-0.0.1.vsix`
64+
5. `code --install-extension ghcide-0.0.1.vsix`
6565

66-
Now openning a `.hs` file should work with `hie-core`.
66+
Now openning a `.hs` file should work with `ghcide`.
6767

6868
### Using with Emacs
6969

@@ -86,7 +86,7 @@ If you don't already have [MELPA](https://melpa.org/#/) package installation con
8686
(use-package lsp-haskell
8787
:ensure t
8888
:config
89-
(setq lsp-haskell-process-path-hie "hie-core")
89+
(setq lsp-haskell-process-path-hie "ghcide")
9090
(setq lsp-haskell-process-args-hie '())
9191
;; Comment/uncomment this line to see interactions between lsp client/server.
9292
;;(setq lsp-log-io t)
@@ -103,7 +103,7 @@ Add this to your vim config:
103103
let g:LanguageClient_rootMarkers = ['*.cabal', 'stack.yaml']
104104
let g:LanguageClient_serverCommands = {
105105
\ 'rust': ['rls'],
106-
\ 'haskell': ['hie-core', '--lsp'],
106+
\ 'haskell': ['ghcide', '--lsp'],
107107
\ }
108108
```
109109

@@ -116,8 +116,8 @@ Add this to your vim config:
116116

117117
```vim
118118
au User lsp_setup call lsp#register_server({
119-
\ 'name': 'hie-core',
120-
\ 'cmd': {server_info->['/your/path/to/hie-core', '--lsp']},
119+
\ 'name': 'ghcide',
120+
\ 'cmd': {server_info->['/your/path/to/ghcide', '--lsp']},
121121
\ 'whitelist': ['haskell'],
122122
\ })
123123
```

exe/Arguments.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ getArguments = execParser opts
1818
opts = info (arguments <**> helper)
1919
( fullDesc
2020
<> progDesc "Used as a test bed to check your IDE will work"
21-
<> header "hie-core - the core of a Haskell IDE")
21+
<> header "ghcide - the core of a Haskell IDE")
2222

2323
arguments :: Parser Arguments
2424
arguments = Arguments

exe/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ main :: IO ()
5252
main = do
5353
-- WARNING: If you write to stdout before runLanguageServer
5454
-- then the language server will not work
55-
hPutStrLn stderr $ "Starting hie-core (GHC v" ++ showVersion compilerVersion ++ ")"
55+
hPutStrLn stderr $ "Starting ghcide (GHC v" ++ showVersion compilerVersion ++ ")"
5656
Arguments{..} <- getArguments
5757

5858
-- lock to avoid overlapping output on stdout

extension/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extension/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "hie-core",
3-
"displayName": "hie-core",
2+
"name": "ghcide",
3+
"displayName": "ghcide",
44
"publisher": "digitalasset",
55
"repository": {
66
"type" : "git",
@@ -31,8 +31,8 @@
3131
"properties": {
3232
"hic.executablePath": {
3333
"type": "string",
34-
"default": "hie-core",
35-
"description": "The location of your hie-core executable"
34+
"default": "ghcide",
35+
"description": "The location of your ghcide executable"
3636
},
3737
"hic.arguments": {
3838
"type": "string",

hie-core-daml.sh renamed to ghcide-daml.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ cd "$(dirname "$0")"/../..
77
export RULES_HASKELL_EXEC_ROOT=$PWD/
88
ENV_FILE=$(mktemp)
99
ARGS_FILE=$(mktemp)
10-
bazel build //compiler/hie-core:hie-core-exe >/dev/null 2>&1
10+
bazel build //compiler/ghcide:ghcide-exe >/dev/null 2>&1
1111
bazel run --define hie_bios_ghci=True //compiler/damlc:damlc@ghci -- "$ENV_FILE" "$ARGS_FILE" >/dev/null 2>&1
1212
source "$ENV_FILE"
1313
export HIE_BIOS_ARGS="$ARGS_FILE"
14-
./bazel-bin/compiler/hie-core/hie-core-exe $@
14+
./bazel-bin/compiler/ghcide/ghcide-exe $@
1515

hie-core.cabal renamed to ghcide.cabal

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 1.20
22
build-type: Simple
33
category: Development
4-
name: hie-core
4+
name: ghcide
55
version: 0.0.1
66
license: Apache-2.0
77
license-file: LICENSE
@@ -114,7 +114,7 @@ library
114114
Development.IDE.Spans.Documentation
115115
Development.IDE.Spans.Type
116116

117-
executable hie-core
117+
executable ghcide
118118
default-language: Haskell2010
119119
hs-source-dirs: exe
120120
ghc-options: -threaded
@@ -130,7 +130,7 @@ executable hie-core
130130
ghc,
131131
haskell-lsp,
132132
hie-bios,
133-
hie-core,
133+
ghcide,
134134
optparse-applicative,
135135
shake,
136136
text
@@ -142,11 +142,11 @@ executable hie-core
142142
TupleSections
143143
ViewPatterns
144144

145-
test-suite hie-core-tests
145+
test-suite ghcide-tests
146146
type: exitcode-stdio-1.0
147147
default-language: Haskell2010
148148
build-tool-depends:
149-
hie-core:hie-core
149+
ghcide:ghcide
150150
build-depends:
151151
base,
152152
containers,

install.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
:: Copyright (c) 2019 The DAML Authors. All rights reserved.
22
:: SPDX-License-Identifier: Apache-2.0
33

4-
@REM Install hie-core where cabal install would put it on Windows
4+
@REM Install ghcide where cabal install would put it on Windows
55
@REM but avoid checking configure or installing local libraries (faster)
6-
ghc Main -o dist\obj\hie-core.exe -XBangPatterns -XDeriveGeneric -XGeneralizedNewtypeDeriving -XLambdaCase -XNamedFieldPuns -XRecordWildCards -XScopedTypeVariables -XStandaloneDeriving -XTupleSections -XTypeApplications -XViewPatterns -package=ghc -DGHC_STABLE -isrc -iexe -outputdir dist\obj && copy dist\obj\hie-core.exe %AppData%\cabal\bin\hie-core.exe
6+
ghc Main -o dist\obj\ghcide.exe -XBangPatterns -XDeriveGeneric -XGeneralizedNewtypeDeriving -XLambdaCase -XNamedFieldPuns -XRecordWildCards -XScopedTypeVariables -XStandaloneDeriving -XTupleSections -XTypeApplications -XViewPatterns -package=ghc -DGHC_STABLE -isrc -iexe -outputdir dist\obj && copy dist\obj\ghcide.exe %AppData%\cabal\bin\ghcide.exe

src/Development/IDE/Core/Compile.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,16 +281,16 @@ runCpp dflags filename contents = withTempDir $ \dir -> do
281281
dflags <- return $ addIncludePathsQuote (takeDirectory filename) dflags
282282

283283
-- Location information is wrong, so we fix that by patching it afterwards.
284-
let inp = dir </> "___HIE_CORE_MAGIC___"
284+
let inp = dir </> "___GHCIDE_MAGIC___"
285285
withBinaryFile inp WriteMode $ \h ->
286286
hPutStringBuffer h contents
287287
doCpp dflags True inp out
288288

289289
-- Fix up the filename in lines like:
290-
-- # 1 "C:/Temp/extra-dir-914611385186/___HIE_CORE_MAGIC___"
290+
-- # 1 "C:/Temp/extra-dir-914611385186/___GHCIDE_MAGIC___"
291291
let tweak x
292292
| Just x <- stripPrefix "# " x
293-
, "___HIE_CORE_MAGIC___" `isInfixOf` x
293+
, "___GHCIDE_MAGIC___" `isInfixOf` x
294294
, let num = takeWhile (not . isSpace) x
295295
-- important to use /, and never \ for paths, even on Windows, since then C escapes them
296296
-- and GHC gets all confused

src/Development/IDE/GHC/Error.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ diagFromText diagSource sev loc msg = (toNormalizedFilePath $ srcSpanToFilename
3434
Diagnostic
3535
{ _range = srcSpanToRange loc
3636
, _severity = Just sev
37-
, _source = Just diagSource -- not shown in the IDE, but useful for hie-core developers
37+
, _source = Just diagSource -- not shown in the IDE, but useful for ghcide developers
3838
, _message = msg
3939
, _code = Nothing
4040
, _relatedInformation = Nothing

test/BUILD.bazel

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ load(
88
)
99

1010
da_haskell_library(
11-
name = "hie-core-testing",
11+
name = "ghcide-testing",
1212
srcs = glob(["src/**/*.hs"]),
1313
hackage_deps = [
1414
"base",
@@ -23,12 +23,12 @@ da_haskell_library(
2323
src_strip_prefix = "src",
2424
visibility = ["//visibility:public"],
2525
deps = [
26-
"//compiler/hie-core",
26+
"//compiler/ghcide",
2727
],
2828
)
2929

3030
da_haskell_library(
31-
name = "hie-core-test-runfiles",
31+
name = "ghcide-test-runfiles",
3232
srcs = glob(["bazel/**/*.hs"]),
3333
hackage_deps = [
3434
"base",
@@ -42,9 +42,9 @@ da_haskell_library(
4242
)
4343

4444
da_haskell_test(
45-
name = "hie-core-tests",
45+
name = "ghcide-tests",
4646
srcs = glob(["exe/**/*.hs"]),
47-
data = ["//compiler/hie-core:hie-core-exe"],
47+
data = ["//compiler/ghcide:ghcide-exe"],
4848
hackage_deps = [
4949
"base",
5050
"extra",
@@ -57,8 +57,8 @@ da_haskell_test(
5757
],
5858
src_strip_prefix = "exe",
5959
deps = [
60-
":hie-core-test-runfiles",
61-
":hie-core-testing",
62-
"//compiler/hie-core",
60+
":ghcide-test-runfiles",
61+
":ghcide-testing",
62+
"//compiler/ghcide",
6363
],
6464
)

test/bazel/Development/IDE/Test/Runfiles.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
-- SPDX-License-Identifier: Apache-2.0
33

44
module Development.IDE.Test.Runfiles
5-
( locateHieCoreExecutable
5+
( locateGhcideExecutable
66
) where
77

88
import System.FilePath ((</>), FilePath)
99

1010
import DA.Bazel.Runfiles
1111

1212

13-
locateHieCoreExecutable :: IO FilePath
14-
locateHieCoreExecutable = locateRunfiles hieCoreExePath
13+
locateGhcideExecutable :: IO FilePath
14+
locateGhcideExecutable = locateRunfiles ghcideExePath
1515
where
16-
hieCoreExePath = mainWorkspace </> exe "compiler/hie-core/hie-core-exe"
16+
ghcideExePath = mainWorkspace </> exe "compiler/ghcide/ghcide-exe"

test/cabal/Development/IDE/Test/Runfiles.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
-- SPDX-License-Identifier: Apache-2.0
33

44
module Development.IDE.Test.Runfiles
5-
( locateHieCoreExecutable
5+
( locateGhcideExecutable
66
) where
77

88
import System.FilePath (FilePath)
99

1010

11-
locateHieCoreExecutable :: IO FilePath
12-
locateHieCoreExecutable = pure "hie-core"
11+
locateGhcideExecutable :: IO FilePath
12+
locateGhcideExecutable = pure "ghcide"

test/exe/Main.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ testSession name = testCase name . run
152152

153153
run :: Session a -> IO a
154154
run s = withTempDir $ \dir -> do
155-
hieCoreExe <- locateHieCoreExecutable
156-
let cmd = unwords [hieCoreExe, "--lsp", "--cwd", dir]
155+
ghcideExe <- locateGhcideExecutable
156+
let cmd = unwords [ghcideExe, "--lsp", "--cwd", dir]
157157
-- HIE calls getXgdDirectory which assumes that HOME is set.
158158
-- Only sets HOME if it wasn't already set.
159159
setEnv "HOME" "/homeless-shelter" False

0 commit comments

Comments
 (0)