Skip to content

Commit 1c94c3e

Browse files
committed
Rename extension to just 'Haskell'
Also update README and use throwing to propagate ghc version errors
1 parent 14d2fed commit 1c94c3e

File tree

8 files changed

+87
-93
lines changed

8 files changed

+87
-93
lines changed

README.md

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,73 @@
1-
# Haskell Language Server Client
1+
# Haskell for Visual Studio Code
22

3-
Client interface to the Language Server Protocol server for Haskell, as provided by the [Haskell IDE Engine](https://github.com/haskell/haskell-ide-engine), [ghcide](https://github.com/digital-asset/ghcide) or the new [Haskell Language Server](https://github.com/haskell/haskell-language-server).
4-
Check the [requirements](#user-content-requirements) for dependencies.
5-
6-
**It is still under development!** If you want to help, get started by reading [Contributing](https://github.com/alanz/vscode-hie-server/blob/master/Contributing.md) for more details.
7-
8-
## Requirements
9-
10-
The language client requires you to manually install at least one of:
11-
12-
- [Haskell IDE Engine](https://github.com/haskell/haskell-ide-engine#installation): It was the unique haskell LSP server supported by this extension until version `0.40.0`. It is stable and functional but it will be replaced sooner or later by the new Haskell Language Server (see below).
13-
- [ghcide](https://github.com/digital-asset/ghcide#install-ghcide): A fast and reliable LSP server with the [main basic features](https://github.com/digital-asset/ghcide#features). Supported since the `0.40.0` version of the extension.
14-
- [Haskell language server](https://github.com/haskell/haskell-language-server#installation): The future successor of haskell-ide-engine. It is still under heavy development and it does not have all the features of haskell-ide-engine, yet, so use at your own risk! It is supported since the `0.40.0` version of the extension.
3+
This is the Visual Studio Code extension for the [Haskell programming language](https://haskell.org), powered by the [Haskell Langauge Server](https://github.com/haskell/haskell-language-server).
154

165
## Features
176

18-
Language server client for haskell using the [HIE](https://github.com/haskell/haskell-ide-engine) language server. Supports,
19-
20-
- Diagnostics via HLint and GHC warnings/errors
7+
- Warning and error diagnostics
218
- Code actions and quick-fixes via [`apply-refact`](https://github.com/mpickering/apply-refact) (click the lightbulb)
22-
- Type information and documentation (via hoogle) on hover
23-
- Jump to definition (`F12` or `Go to Definition` in command palette)
9+
- Type information and documentation on hover
10+
- Jump to definition (`F12` or `Go to Definition` in the command palette)
2411
- List all top level definitions
2512
- Highlight references in document
26-
- Completion
13+
- Code completion
2714
- Formatting via [`brittany`](https://github.com/lspitzner/brittany) (`^ ⌥ B` or `Format Document` in command palette)
28-
- Renaming via [`HaRe`](https://github.com/alanz/HaRe) (`F2` or `Rename Symbol` in command palette)
2915
- [Multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) support
3016

31-
Additionally the language server itself features,
32-
33-
- Supports plain GHC projects, cabal projects and stack projects
34-
- Fast due to caching of compile info
17+
## Requirements
3518

36-
The other two language servers ([ghcide](https://github.com/digital-asset/ghcide#features) and haskell-language-server) have a subset of the features described above.
19+
- For standalone `.hs`/`.lhs` files, [ghc](https://www.haskell.org/ghc/) must be installed and on the PATH. The easiest way to install it is with [ghcup](https://www.haskell.org/ghcup/).
20+
- For Cabal based projects, [cabal-install](https://www.haskell.org/cabal/) must be installed and on the PATH. It can also be installed with [ghcup](https://www.haskell.org/ghcup/).
21+
- For Stack based projects, [stack](http://haskellstack.org) must be installed and on the PATH.
3722

3823
## Supported GHC versions
3924

40-
vscode-hie-server depends on the chosen haskell language server to support different versions of GHC. At the moment of writing the following versions are supported using Haskell Ide Engine: 8.4, 8.6 and 8.8. ghcide and Haskell Language Server also have support for ghc 8.10. If your project uses any other GHC version it won't work.
25+
| GHC | Linux | macOS | Windows |
26+
| ------ | ----- | ----- | ------- |
27+
| 8.10.1 ||||
28+
| 8.8.3 |||
29+
| 8.8.2 |||
30+
| 8.6.5 ||||
31+
| 8.6.4 ||||
32+
33+
## Language Servers
34+
35+
This extension also supports several other language servers for Haskell, some which need to be manually installed:
36+
37+
- [Haskell Language Server](https://github.com/haskell/haskell-language-server#installation): This is the default language server which will automatically be downloaded, so no installation should be needed. It builds upon ghcide by providing extra plugins and features.
38+
- [ghcide](https://github.com/digital-asset/ghcide#install-ghcide): A fast and reliable LSP server with support for [basic features](https://github.com/digital-asset/ghcide#features).
39+
- [Haskell IDE Engine](https://github.com/haskell/haskell-ide-engine#installation): A stable and mature language server, but note that development has moved from this to the Haskell Language Server.
4140

4241
## Extension Settings
4342

4443
You can disable HLint and also control the maximum number of reported problems,
4544

4645
```json
47-
"languageServerHaskell.hlintOn": true,
48-
"languageServerHaskell.maxNumberOfProblems": 100,
46+
"haskell.hlintOn": true,
47+
"haskell.maxNumberOfProblems": 100,
4948
```
5049

5150
If the liquid haskell executable is installed, enable using it to
5251
process haskell files on save.
5352

5453
```json
55-
"languageServerHaskell.liquidOn": true,
54+
"haskell.liquidOn": true,
5655
```
5756

58-
### HIE Variant
59-
60-
Since `0.40` the extension has a selection over the three supported language servers:
61-
`haskell-ide-engine`, `ghcide` and `haskell-language-server`.
62-
The default one is `haskell-ide-engine`, although it will be changed by `haskell-language-server`
63-
when it will be stable enough.
64-
65-
The extension will look for the language server executable in `$PATH` and it will call it
66-
with the appropiate params depending on the extension settings.
67-
However, not all extension settings can be applied to all the language servers:
68-
69-
- `haskell-ide-engine`: It supports all of them.
70-
- `ghcide`: It does not support any of them.
71-
- `haskell-language-server`: For now it only supports the log related settings: `Log File` and `Trace:server`. The goal is to support the same settings as `haskell-ide-engine`.
72-
73-
### Enable/disable HIE
57+
### Enable/disable server
7458

7559
You can enable or disable the chosen haskell language server via configuration. This is sometimes useful at workspace level, because multi-root workspaces do not yet allow you to manage extensions at the folder level, which can be necessary.
7660

7761
```json
78-
"languageServerHaskell.enableHIE": true
62+
"haskell.enable": true
7963
```
8064

81-
### Path for hie executable
65+
### Path to server executable executable
8266

83-
If your chosen haskell language server executable is not on your path, you can manually set it,
67+
If your server is manually installed and not on your path, you can also manually set the path to the executable.
8468

8569
```json
86-
"languageServerHaskell.serverExecutablePath": "~/.local/bin/hie"
70+
"haskell.serverExecutablePath": "~/.local/bin/hie"
8771
```
8872

8973
There are a few placeholders which will be expanded:
@@ -145,6 +129,16 @@ First, check out [what multi-root workspaces](https://code.visualstudio.com/docs
145129

146130
HIE is now started for each workspace folder you have in your multi-root workspace, and several configurations are on a resource (i.e. folder) scope, instead of window (i.e. global) scope.
147131

132+
## Downloaded language servers
133+
134+
This extension will download the language server binaries to a specific location depending on your system. If you find yourself running out of disk space, you can try deleting old versions of language servers in this directory. The extension will redownload them, no strings attached.
135+
| Platform | Path |
136+
|----------|------|
137+
| macOS | `~/Library/Application\ Support/Code/User/globalStorage/alanz.vscode-hie-server/` |
138+
| Windows | `%APPDATA%\Code\User\globalStorage\alanz.vscode-hie-server` |
139+
| Linux | TODO |
140+
141+
148142
## Investigating and reporting problems
149143

150144
1. Go to extensions and right click `Haskell Language Server` and choose `Configure Extensions Settings`
@@ -164,6 +158,9 @@ Now you will see the information which you can use to diagnose or report a probl
164158
* *Common issues*:
165159
* For now, the extension is not able to open a single haskell source file. You need to open a workspace or folder, configured to be built with cabal, stack or other hie-bios compatible program.
166160
* Check you don't have other haskell extensions active, they can interfere with each other.
161+
## Contributing
162+
163+
If you want to help, get started by reading [Contributing](https://github.com/alanz/vscode-hie-server/blob/master/Contributing.md) for more details.
167164

168165
## Release Notes
169166

images/HIE_logo_128.png

-5.3 KB
Binary file not shown.

images/HaskellLogo.png

-4.22 KB
Binary file not shown.

images/haskell-logo.png

11.1 KB
Loading

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.

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "vscode-hie-server",
3-
"displayName": "Haskell Language Server",
4-
"description": "Haskell language support powered by HLS, ghcide or HIE",
5-
"version": "0.0.40",
3+
"displayName": "Haskell",
4+
"description": "Haskell language support powered by the Haskell Language Server, ghcide or HIE",
5+
"version": "0.1.0",
66
"license": "MIT",
77
"publisher": "alanz",
88
"engines": {
@@ -28,7 +28,7 @@
2828
"Linters",
2929
"Other"
3030
],
31-
"icon": "images/HIE_logo_128.png",
31+
"icon": "images/haskell-logo.png",
3232
"galleryBanner": {
3333
"color": "#22172A",
3434
"theme": "dark"
@@ -63,47 +63,47 @@
6363
],
6464
"configuration": {
6565
"type": "object",
66-
"title": "Haskell Language Server",
66+
"title": "Haskell",
6767
"properties": {
68-
"languageServerHaskell.hlintOn": {
68+
"haskell.hlintOn": {
6969
"title": "Hlint",
7070
"scope": "resource",
7171
"type": "boolean",
7272
"default": true,
7373
"description": "Get suggestions from hlint"
7474
},
75-
"languageServerHaskell.maxNumberOfProblems": {
75+
"haskell.maxNumberOfProblems": {
7676
"scope": "resource",
7777
"type": "number",
7878
"default": 100,
7979
"description": "Controls the maximum number of problems produced by the server"
8080
},
81-
"languageServerHaskell.diagnosticsOnChange": {
81+
"haskell.diagnosticsOnChange": {
8282
"scope": "resource",
8383
"type": "boolean",
8484
"default": true,
8585
"description": "Compute diagnostics continuously as you type. Turn off to only generate diagnostics on file save."
8686
},
87-
"languageServerHaskell.liquidOn": {
87+
"haskell.liquidOn": {
8888
"scope": "resource",
8989
"type": "boolean",
9090
"default": false,
9191
"description": "Get diagnostics from liquid haskell"
9292
},
93-
"languageServerHaskell.completionSnippetsOn": {
93+
"haskell.completionSnippetsOn": {
9494
"title": "Completion Snippets",
9595
"scope": "resource",
9696
"type": "boolean",
9797
"default": true,
9898
"description": "Show snippets with type information when using code completion"
9999
},
100-
"languageServerHaskell.formatOnImportOn": {
100+
"haskell.formatOnImportOn": {
101101
"scope": "resource",
102102
"type": "boolean",
103103
"default": true,
104104
"description": "When adding an import, use the formatter on the result"
105105
},
106-
"languageServerHaskell.formattingProvider": {
106+
"haskell.formattingProvider": {
107107
"scope": "resource",
108108
"type": "string",
109109
"enum": [
@@ -116,7 +116,7 @@
116116
"default": "brittany",
117117
"description": "The tool to use for formatting requests"
118118
},
119-
"languageServerHaskell.trace.server": {
119+
"haskell.trace.server": {
120120
"scope": "resource",
121121
"type": "string",
122122
"enum": [
@@ -126,13 +126,13 @@
126126
"default": "off",
127127
"description": "Traces the communication between VS Code and the language server."
128128
},
129-
"languageServerHaskell.logFile": {
129+
"haskell.logFile": {
130130
"scope": "resource",
131131
"type": "string",
132132
"default": "",
133133
"description": "If set, redirects the logs to a file."
134134
},
135-
"languageServerHaskell.serverVariant": {
135+
"haskell.languageServerVariant": {
136136
"scope": "resource",
137137
"type": "string",
138138
"enum": [
@@ -143,13 +143,13 @@
143143
"default": "haskell-language-server",
144144
"description": "Which language server to use."
145145
},
146-
"languageServerHaskell.serverExecutablePath": {
146+
"haskell.serverExecutablePath": {
147147
"scope": "resource",
148148
"type": "string",
149149
"default": "",
150150
"description": "Set the path to your language server executable, if it's not already on your $PATH. Works with ~, ${HOME} and ${workspaceFolder}."
151151
},
152-
"languageServerHaskell.enableHIE": {
152+
"haskell.enable": {
153153
"scope": "resource",
154154
"type": "boolean",
155155
"default": true,

src/extension.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export async function activate(context: ExtensionContext) {
6363
}
6464

6565
function findManualExecutable(uri: Uri, folder?: WorkspaceFolder): string | null {
66-
let exePath = workspace.getConfiguration('languageServerHaskell', uri).serverExecutablePath;
66+
let exePath = workspace.getConfiguration('haskell', uri).serverExecutablePath;
6767
if (exePath === '') {
6868
return null;
6969
}
@@ -82,7 +82,7 @@ function findManualExecutable(uri: Uri, folder?: WorkspaceFolder): string | null
8282

8383
/** Searches the PATH for whatever is set in serverVariant */
8484
function findLocalServer(context: ExtensionContext, uri: Uri, folder?: WorkspaceFolder): string | null {
85-
const serverVariant = workspace.getConfiguration('languageServerHaskell', uri).serverVariant;
85+
const serverVariant = workspace.getConfiguration('haskell', uri).languageServerVariant;
8686

8787
// Set the executable, based on the settings.
8888
let exes: string[] = []; // should get set below
@@ -130,13 +130,13 @@ async function activateHie(context: ExtensionContext, document: TextDocument) {
130130

131131
async function activateHieNoCheck(context: ExtensionContext, uri: Uri, folder?: WorkspaceFolder) {
132132
// Stop right here, if HIE is disabled in the resource/workspace folder.
133-
const enableHIE = workspace.getConfiguration('languageServerHaskell', uri).enableHIE;
134-
if (!enableHIE) {
133+
const enable = workspace.getConfiguration('haskell', uri).enable;
134+
if (!enable) {
135135
return;
136136
}
137137

138-
const logLevel = workspace.getConfiguration('languageServerHaskell', uri).trace.server;
139-
const logFile = workspace.getConfiguration('languageServerHaskell', uri).logFile;
138+
const logLevel = workspace.getConfiguration('haskell', uri).trace.server;
139+
const logFile = workspace.getConfiguration('haskell', uri).logFile;
140140

141141
let serverExecutable;
142142
try {
@@ -158,7 +158,7 @@ async function activateHieNoCheck(context: ExtensionContext, uri: Uri, folder?:
158158
const runArgs: string[] = ['--lsp'];
159159
let debugArgs: string[] = ['--lsp'];
160160

161-
const serverVariant = workspace.getConfiguration('languageServerHaskell', uri).serverVariant;
161+
const serverVariant = workspace.getConfiguration('haskell', uri).languageServerVariant;
162162
// ghcide does not accept -d and -l params
163163
if (serverVariant !== 'ghcide') {
164164
if (logLevel === 'messages') {
@@ -201,8 +201,8 @@ async function activateHieNoCheck(context: ExtensionContext, uri: Uri, folder?:
201201
{ scheme: 'file', language: 'literate haskell', pattern: pat },
202202
],
203203
synchronize: {
204-
// Synchronize the setting section 'languageServerHaskell' to the server.
205-
configurationSection: 'languageServerHaskell',
204+
// Synchronize the setting section 'haskell' to the server.
205+
configurationSection: 'haskell',
206206
},
207207
diagnosticCollectionName: langName,
208208
revealOutputChannelOn: RevealOutputChannelOn.Never,
@@ -249,7 +249,7 @@ export function deactivate(): Thenable<void> {
249249
}
250250

251251
function showNotInstalledErrorMessage(uri: Uri) {
252-
const variant = workspace.getConfiguration('languageServerHaskell', uri).serverVariant;
252+
const variant = workspace.getConfiguration('haskell', uri).languageServerVariant;
253253
let projectUrl = '';
254254
switch (variant) {
255255
case 'haskell-ide-engine':

0 commit comments

Comments
 (0)