mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-04 15:52:08 +03:00
Add IDE Readme (#1678)
* Add .vscode settings that are useful for making it easier to build * Ignore the extension output * Add a README that describes how to start the IDE
This commit is contained in:
parent
18df605494
commit
e823c5d431
28
README.md
28
README.md
@ -1 +1,27 @@
|
|||||||
A lightweight, extensible base for LSP IDE tooling based on Shake and GHC Lib
|
# Haskell IDE Core
|
||||||
|
|
||||||
|
Our vision is that you should build an IDE by combining:
|
||||||
|
|
||||||
|
* [hie-bios](https://github.com/mpickering/haskell-ide-engine/tree/hie-bios/hie-bios) for determining where your files are, what the dependencies, what extensions are enabled etc.
|
||||||
|
* `haskell-ide-core` - this library - for defining how to type check, when to type check, and producing messages.
|
||||||
|
* `haskell-lsp` for sending those messages to an LSP server.
|
||||||
|
* A VS Code extension, e.g. `extension` in this directory.
|
||||||
|
|
||||||
|
There are more details [in this blog post](https://4ta.uk/p/shaking-up-the-ide).
|
||||||
|
|
||||||
|
## How to use it
|
||||||
|
|
||||||
|
Let's assume you want to load the `haskell-ide-core` source code in a VS Code IDE.
|
||||||
|
|
||||||
|
1. `git clone https://github.com/digital-asset/daml.git`
|
||||||
|
2. `cd compiler/haskell-ide-core`
|
||||||
|
3. `stack build`
|
||||||
|
4. `cd extension`
|
||||||
|
5. `npm install`
|
||||||
|
6. `code .`
|
||||||
|
7. Press F5 to start the extension.
|
||||||
|
8. In the spawned extension, open the folder `haskell-ide-core`.
|
||||||
|
9. In the preferences, set the Haskell IDE Core executable preference to `stack` and the arguments to `exec -- ide-demo --ide .ghci`
|
||||||
|
10. Run the Reload Window command in VS Code.
|
||||||
|
|
||||||
|
Now you should have a working IDE dealing with itself.
|
||||||
|
7
extension/.vscode/extensions.json
vendored
Normal file
7
extension/.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||||
|
// for the documentation about the extensions.json format
|
||||||
|
"recommendations": [
|
||||||
|
"ms-vscode.vscode-typescript-tslint-plugin"
|
||||||
|
]
|
||||||
|
}
|
35
extension/.vscode/launch.json
vendored
Normal file
35
extension/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
// A launch configuration that compiles the extension and then opens it inside a new window
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [{
|
||||||
|
"name": "Run Extension",
|
||||||
|
"type": "extensionHost",
|
||||||
|
"request": "launch",
|
||||||
|
"runtimeExecutable": "${execPath}",
|
||||||
|
"args": [
|
||||||
|
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||||
|
],
|
||||||
|
"outFiles": [
|
||||||
|
"${workspaceFolder}/out/**/*.js"
|
||||||
|
],
|
||||||
|
"preLaunchTask": "npm: watch"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Extension Tests",
|
||||||
|
"type": "extensionHost",
|
||||||
|
"request": "launch",
|
||||||
|
"runtimeExecutable": "${execPath}",
|
||||||
|
"args": [
|
||||||
|
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||||
|
"--extensionTestsPath=${workspaceFolder}/out/test"
|
||||||
|
],
|
||||||
|
"outFiles": [
|
||||||
|
"${workspaceFolder}/out/test/**/*.js"
|
||||||
|
],
|
||||||
|
"preLaunchTask": "npm: watch"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
11
extension/.vscode/settings.json
vendored
Normal file
11
extension/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// Place your settings in this file to overwrite default and user settings.
|
||||||
|
{
|
||||||
|
"files.exclude": {
|
||||||
|
"out": false // set this to true to hide the "out" folder with the compiled JS files
|
||||||
|
},
|
||||||
|
"search.exclude": {
|
||||||
|
"out": true // set this to false to include "out" folder in search results
|
||||||
|
},
|
||||||
|
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
|
||||||
|
"typescript.tsc.autoDetect": "off"
|
||||||
|
}
|
20
extension/.vscode/tasks.json
vendored
Normal file
20
extension/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"type": "npm",
|
||||||
|
"script": "watch",
|
||||||
|
"problemMatcher": "$tsc-watch",
|
||||||
|
"isBackground": true,
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "never"
|
||||||
|
},
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user