Skip to content

Commit de3caa6

Browse files
committed
Update README.md and CONTRIBUTING.md
Also remove tests since they were only JS stubs
1 parent 644af3a commit de3caa6

File tree

6 files changed

+48
-128
lines changed

6 files changed

+48
-128
lines changed

Contributing.md

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,46 @@
11
# Contributing
22

3-
This document will briefly outline how to get started contributing to the `vscode-hie-server` Haskell language client for the [Haskell-IDE-Engine](https://github.com/haskell/haskell-ide-engine) language server.
4-
53
## Dependencies and Building
64

7-
For development, all you need is to,
8-
9-
* run `npm install -g typescript` to get [TypeScript](https://www.typescriptlang.org),
10-
* run `npm install -g webpack` to get [Webpack](https://webpack.js.org),
11-
* then run `npm install` in the project root to install development dependencies.
5+
Run `npm install` in the project root to install the development dependencies.
126

13-
You can now also package up the extension with,
7+
You can also package up the extension with
148

15-
* `npm install -g vsce` to get the Extension Manager,
16-
* `vsce package` which creates an extension package at `vscode-hie-server-<version>.vsix`.
9+
- `npm install -g vsce` to get the Extension Manager,
10+
- `vsce package` which creates an extension package at `vscode-hie-server-<version>.vsix`.
1711

1812
_Note:_ that if you get errors running `vsce package`, it might help running `tsc -p ./` directly, since that gives the actual error output of the TypeScript compilation.
1913

20-
## Developing
14+
## Developing inside VS Code
2115

22-
* Launch VS Code, press `File` > `Open Folder`, open the `vscode-hie-server` folder;
23-
* press `F5` to open a new window with the `vscode-hie-server` loaded (this will overwrite existing ones, e.g. from the marketplace);
24-
* open a Haskell file with the **new** editor to test the LSP client;
16+
- Launch VS Code, press `File` > `Open Folder`, open the `vscode-hie-server` folder;
17+
- press `F5` to open a new window with the `vscode-hie-server` loaded (this will overwrite existing ones, e.g. from the marketplace);
18+
- open a Haskell file with the **new** editor to test the LSP client;
2519

2620
You are now ready to make changes and debug. You can,
2721

28-
* set breakpoints in your code inside `src/extension.ts` to debug your extension;
29-
* find output from your extension in the debug console;
30-
* make changes to the code, and then
31-
* relaunch the extension from the debug toolbar
22+
- set breakpoints in your code inside `src/extension.ts` to debug your extension;
23+
- find output from your extension in the debug console;
24+
- make changes to the code, and then
25+
- relaunch the extension from the debug toolbar
3226

3327
_Note_: you can also reload (`Ctrl+R` or `Cmd+R` on macOS) the VS Code window with your extension to load your changes
3428

3529
#### Formatting
3630

37-
To keep a consistent style, it's best to run [prettier](https://prettier.io) on each save. If you are using VSCode, the settings are set to auto format on save.
38-
39-
There is usually an extension for your editor for prettier, e.g. [`esbenp.prettier-vscode`](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode), which you can install through the marketplace or via `ext install prettier-vscode`.
40-
31+
[prettier](https://prettier.io) is automatically run o neach commit via husky. If you are developing within VS Code, the settings are set to auto format on save.
4132
The configurations for prettier are located in `.prettierrc`.
4233

4334
## Navigating the Files
4435

4536
A brief overview of the files,
4637

47-
* `package.json` contains the basic information about the package, see [the full manifest for more](https://code.visualstudio.com/docs/extensionAPI/extension-manifest), such as telling VS Code which scope the LSP works on (Haskell and Literate Haskell in our case), and possible configuration
48-
* `src/extension.ts` handles activating and deactivating the HIE language server, along with checking if HIE is installed
49-
* `src/docsBrowser.ts` contains the logic for displaying the documentation browser (e.g. hover over a type like `mapM_` and click `Documentation` or `Source`)
50-
* `src/commands/constants.ts` simply exports the rest of the commands in folder
51-
* `src/commands/showType.ts` handles showing a type using `ghcmod:type`
52-
* `src/commands/insertType.ts` handles inserting a type using the output of `ghcmod:type`
38+
- `package.json` contains the basic information about the package, see [the full manifest for more](https://code.visualstudio.com/docs/extensionAPI/extension-manifest), such as telling VS Code which scope the LSP works on (Haskell and Literate Haskell in our case), and possible configuration
39+
- `src/extension.ts` is the main entrypoint to the extension, and handles launching the language server.
40+
- `src/hlsBinaries.ts` handles automatically installing the pre-built `haskell-language-server` binaries
41+
- `src/utils.ts` has some functions for downloading files and checking if executables are on the path
42+
- `src/docsBrowser.ts` contains the logic for displaying the documentation browser (e.g. hover over a type like `mapM_` and click `Documentation` or `Source`)
5343

5444
## Helpful Reading Material
5545

5646
We recommend checking out [Your First VS Code Extension](https://code.visualstudio.com/docs/extensions/example-hello-world) and [Creating a Language Server](https://code.visualstudio.com/docs/extensions/example-language-server) for some introduction to VS Code extensions.
57-
58-
## Running tests
59-
60-
There are two ways to run (the same) tests, you can either
61-
62-
* press `F8` to run the tests using `npm test`
63-
64-
or
65-
66-
* open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Launch Tests`
67-
* press `F5` to run the tests in a new window with your extension loaded
68-
* see the output of the test result in the debug console
69-
* make changes to `test/extension.test.ts` or create new test files inside the `test` folder
70-
* by convention, the test runner will only consider files matching the name pattern `**.test.ts`
71-
* you can create folders inside the `test` folder to structure your tests any way you want

README.md

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ This is the Visual Studio Code extension for the [Haskell programming language](
55
## Features
66

77
- Warning and error diagnostics from GHC
8-
- Code actions and quick-fixes via [`apply-refact`](https://github.com/mpickering/apply-refact) (click the lightbulb)
98
- Type information and documentation on hover
109
- Jump to definition
1110
- Document symbols
1211
- Highlight references in document
1312
- Code completion
1413
- Formatting via Brittany, Floskell, Ormolu or Stylish Haskell
1514
- [Multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) support
15+
<!-- Add this back when hlint support is merged into hls
16+
- Code actions and quick-fixes via `hlint` and [`apply-refact`](https://github.com/mpickering/apply-refact) (click the lightbulb) -->
1617

1718
## Requirements
1819

@@ -22,23 +23,27 @@ This is the Visual Studio Code extension for the [Haskell programming language](
2223

2324
## Supported GHC versions
2425

26+
Note that these are the versions of GHC that there are binaries of haskell-language-server for. Building from source may support more versions!
27+
2528
| GHC | Linux | macOS | Windows |
2629
| ------ | ----- | ----- | ------- |
2730
| 8.10.1 ||||
28-
| 8.8.3 |||
29-
| 8.8.2 |||
31+
| 8.8.3 ||| |
32+
| 8.8.2 ||| |
3033
| 8.6.5 ||||
3134
| 8.6.4 ||||
3235

3336
## Language Servers
3437

35-
This extension also supports several other language servers for Haskell, some which need to be manually installed:
38+
This extension is powered by the Haskell Language Server by default, but it also supports several others, some which need to be manually installed:
3639

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.
40+
- [Haskell Language Server](https://github.com/haskell/haskell-language-server#installation): This is the default language server which will automatically be downloaded, so it does not need manual installation. It builds upon ghcide by providing extra plugins and features.
3841
- [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).
3942
- [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.
4043

41-
## Extension Settings
44+
You can choose which language server to use from the "Haskell > Language Server Variant" configuration option.
45+
46+
## Configuration options
4247

4348
You can disable HLint and also control the maximum number of reported problems,
4449

@@ -47,13 +52,6 @@ You can disable HLint and also control the maximum number of reported problems,
4752
"haskell.maxNumberOfProblems": 100,
4853
```
4954

50-
If the liquid haskell executable is installed, enable using it to
51-
process haskell files on save.
52-
53-
```json
54-
"haskell.liquidOn": true,
55-
```
56-
5755
### Enable/disable server
5856

5957
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.
@@ -97,39 +95,31 @@ Or alternatively add the following to your `~/.cabal/config` or `cabal.config[.l
9795
documentation: True
9896
```
9997

100-
### Haskell IDE Engine and Hoogle
98+
## Haskell IDE Engine specifics
10199

102-
If you are using Haskell IDE Engine as the language server, it pulls in documentation via Hoogle. After installing Hoogle via `cabal install hoogle` or `stack install hoogle`, generate the database with:
100+
If you are using Haskell IDE Engine as your language server, there are a number of additional configuration options.
103101

104-
```bash
105-
$ hoogle generate
106-
```
102+
### Liquid Haskell
107103

108-
Haskell IDE Engine
104+
If Liquid Haskell is installed, haskell-ide-engine can be configured to run the `liquidhaskell` executable on save and display diagnostics:
109105

110-
## Manual Installation
106+
```json
107+
"haskell.liquidOn": true,
108+
```
111109

112-
Either install the extension via the marketplace (preferred), or if you are testing an unreleased version by,
110+
### Hoogle
111+
112+
HIE pulls in documentation via Hoogle. After installing Hoogle via `cabal install hoogle` or `stack install hoogle`, generate the database with:
113113

114114
```bash
115-
$ npm install -g vsce
116-
$ git clone https://github.com/alanz/vscode-hie-server
117-
$ cd vscode-hie-server
118-
$ npm ci
119-
$ vsce package
115+
$ hoogle generate
120116
```
121117

122-
This will create a file something like `vscode-hie-server-<version>.vsix`
123-
according to the current version.
124-
125-
In VS Code, open the extensions tab, and click on the `...` at the top right of it,
126-
and use the `Install from VSIX...` option to locate and install the generated file.
127-
128118
## Using multi-root workspaces
129119

130120
First, check out [what multi-root workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces) are. The idea of using multi-root workspaces, is to be able to work on several different Haskell projects, where the GHC version or stackage LTS could differ, and have it work smoothly.
131121

132-
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.
122+
The language server 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.
133123

134124
## Downloaded language servers
135125

@@ -141,6 +131,9 @@ This extension will download the language server binaries to a specific location
141131
| Linux | TODO |
142132

143133

134+
Note that if `haskell-language-server-wrapper` is already on the PATH, then the extension will launch it directly instead of downloading binaries.
135+
136+
144137
## Investigating and reporting problems
145138

146139
1. Go to extensions and right click `Haskell` and choose `Configure Extensions Settings`
@@ -149,7 +142,7 @@ This extension will download the language server binaries to a specific location
149142
4. Go to the main menu and choose `View -> Output` (`Ctrl + Shift + U`)
150143
5. On the new Output panel that opens on the right side in the drop down menu choose `Haskell`
151144

152-
Now you will see the information which you can use to diagnose or report a problem
145+
Please include the output when filing any issues on the relevant language server's issue tracker.
153146

154147
### Troubleshooting
155148

@@ -160,6 +153,7 @@ Now you will see the information which you can use to diagnose or report a probl
160153
* *Common issues*:
161154
* 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.
162155
* Check you don't have other haskell extensions active, they can interfere with each other.
156+
163157
## Contributing
164158

165159
If you want to help, get started by reading [Contributing](https://github.com/alanz/vscode-hie-server/blob/master/Contributing.md) for more details.

package-lock.json

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
"keywords": [
1212
"language",
1313
"haskell",
14+
"cabal",
15+
"stack",
1416
"lsp",
1517
"multi-root ready"
1618
],
@@ -175,7 +177,6 @@
175177
"compile": "webpack --mode none",
176178
"watch": "webpack --mode none --watch --info-verbosity verbose",
177179
"postinstall": "node ./node_modules/vscode/bin/install",
178-
"test": "tsc -p . && node ./node_modules/vscode/bin/test",
179180
"tslint": "tslint -p tsconfig.json -c tslint.json --format stylish 'src/**/*.ts'",
180181
"tslint-fix": "tslint --fix -p tsconfig.json -c tslint.json --format stylish 'src/**/*.ts'",
181182
"precommit": "pretty-quick --staged",
@@ -186,7 +187,6 @@
186187
"@types/js-yaml": "^3.12.3",
187188
"@types/lodash-es": "^4.17.3",
188189
"@types/lru-cache": "^4.1.2",
189-
"@types/mocha": "^2.2.46",
190190
"@types/node": "^14.0.3",
191191
"@types/request-promise-native": "^1.0.17",
192192
"husky": "^0.14.3",

test/extension.test.ts

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

test/index.ts

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

0 commit comments

Comments
 (0)