on master help sign in
Hic elisp (#1714)

* Added elisp to the readme * Changed the flags for compatibility with HIE * Change the default arguments to reflect hie compat

commit79d712397b0ca1bbc9aa5ce731a6f1b6165716d2 authorDavidM-D <dmillardurrant@gmail.com> dateTue 18 Jun 2019, 14:10 (7 years ago) parentebbe980
3 files changed+26−14
README.md+23−10 extension/package.json+1−1 test/Demo.hs+2−3
README.md+23−10
@@ -11,23 +11,36 @@ There are more details [in this blog post](https://4ta.uk/p/shaking-up-the-ide).
1111
1212## How to use it
1313
14−Let's assume you want to load the `haskell-ide-core` source code in a VS Code IDE.
14+### Installing the binary
1515
16161. `git clone https://github.com/digital-asset/daml.git`
17172. `cd daml/compiler/haskell-ide-core`
18183. `stack build`
19−4. `cd extension`
20−5. `npm install`
21−6. `code .`
22−7. Press F5 to start the extension.
23−8. In the spawned extension, open the folder `haskell-ide-core`.
24−9. In the preferences, set the Haskell IDE Core executable preference to `stack` and the arguments to `exec -- ide-demo --ide .ghci`
25−10. Run the Reload Window command in VS Code.
2619
27−Now you should have a working IDE dealing with itself.
20+### Using the VSCode extension
2821
29−## Installing the IDE permanently
22+1. `cd extension`
23+2. `npm install`
24+3. `code .`
25+4. Press F5 to start the extension.
26+5. In the spawned extension, open the folder `haskell-ide-core`.
27+6. In the preferences, set the Haskell IDE Core executable preference to `stack` and the arguments to `exec -- ide-demo --lsp .ghci`
28+7. Run the Reload Window command in VS Code.
29+
30+### Installing the VSCode extension permanently
3031
31321. `cd compiler/haskell-ide-core/extension`
32332. `vsce package`
33343. `code --install-extension haskell-ide-core-0.0.1.vsix`
35+
36+### Installing in emacs
37+1. Install lsp and haskell-lsp
38+2. Add this elisp to your .emacs.el
39+```elisp
40+(require 'lsp)
41+(require 'lsp-haskell)
42+(require 'yasnippet)
43+(add-hook 'haskell-mode-hook #'lsp)
44+(setq lsp-haskell-process-path-hie "haskell-ide-core")
45+(setq lsp-haskell-process-args-hie '())
46+```
extension/package.json+1−1
@@ -36,7 +36,7 @@
3636 },
3737 "hic.arguments": {
3838 "type": "string",
39− "default": "--ide",
39+ "default": "--lsp",
4040 "description": "The arguments you would like to pass to the executable"
4141 }
4242 }
test/Demo.hs+2−3
@@ -44,7 +44,6 @@ main = do
4444 -- then the language server will not work
4545 hPutStrLn stderr "Starting haskell-ide-core Demo"
4646 args <- getArgs
47−
4847 -- lock to avoid overlapping output on stdout
4948 lock <- newLock
5049 let logger = makeOneHandle $ withLock lock . T.putStrLn
@@ -64,13 +63,13 @@ main = do
6463 ,optShakeProfiling = Nothing -- Just "output.html"
6564 }
6665
67− if "--ide" `elem` args then do
66+ if "--lsp" `elem` args then do
6867 hPutStrLn stderr "Starting IDE server"
6968 runLanguageServer logger $ \event vfs -> do
7069 hPutStrLn stderr "Server started"
7170 initialise (mainRule >> action kick) event logger options vfs
7271 else do
73− let files = map toNormalizedFilePath $ filter (/= "--ide") args
72+ let files = map toNormalizedFilePath $ filter (/= "--lsp") args
7473 vfs <- makeVFSHandle
7574 ide <- initialise mainRule (showEvent lock) logger options vfs
7675 setFilesOfInterest ide $ Set.fromList files