Skip to content

Commit 77953f9

Browse files
authored
Merge branch 'master' into rename-config
2 parents 4de61c7 + 85beafe commit 77953f9

File tree

12 files changed

+79
-60
lines changed

12 files changed

+79
-60
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Create a report to help us improve
44
title: ''
55
labels: 'status: needs triage'
66
assignees: ''
7-
87
---
98

109
<!--
@@ -16,18 +15,23 @@ When filing an issue, please fill out as much of the information below as you ca
1615
### Your environment
1716

1817
Which OS do you use:
18+
1919
<!-- Windows, MacOS, Ubuntu, ArchLinux, etc... -->
2020

2121
### Steps to reproduce
22+
2223
<!-- Tell us how to reproduce this issue, including screenshots if you think they can be useful -->
2324

2425
### Expected behaviour
26+
2527
<!-- Tell us what should happen. -->
2628

2729
### Actual behaviour
30+
2831
<!-- Tell us what happens instead. -->
2932

3033
### Include debug information
34+
3135
Execute in the root of your project the command `haskell-language-server-wrapper --debug .` and paste the logs here (you can find the executable location [here](https://github.com/haskell/vscode-haskell#downloaded-binaries)):
3236

3337
<details>
@@ -38,6 +42,7 @@ Debug output:
3842
```
3943
<paste your logs here>
4044
```
45+
4146
</details>
4247

4348
Paste the contents of extension specific log, you can check instructions about how to find it [here](https://github.com/haskell/vscode-haskell#troubleshooting)
@@ -50,4 +55,5 @@ Extension log:
5055
```
5156
<paste your logs here>
5257
```
58+
5359
</details>

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Suggest an idea for this project
44
title: ''
55
labels: ''
66
assignees: ''
7-
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929
uses: haskell/actions/setup@v1
3030
with:
3131
ghc-version: ${{ matrix.ghc }}
32-
- name: "Install `tree` for MacOs"
32+
- name: 'Install `tree` for MacOs'
3333
run: |
3434
brew update
3535
brew install tree
3636
if: runner.os == 'macOS'
37-
- name: "Install `tree` for Windows"
37+
- name: 'Install `tree` for Windows'
3838
run: |
3939
choco install tree
4040
if: runner.os == 'Windows'

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules/
2+
test-workspace/
3+
.vscode/
4+
.vscode-test/
5+
out/
6+
dist/
7+
webpack.config.js

README.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ either globally or per project. E.g.:
112112

113113
```json
114114
{
115-
"haskell.toolchain": {
116-
"hls": "1.6.1.1",
117-
"cabal": "recommended",
118-
"stack": null
119-
}
115+
"haskell.toolchain": {
116+
"hls": "1.6.1.1",
117+
"cabal": "recommended",
118+
"stack": null
119+
}
120120
}
121121
```
122122

@@ -131,11 +131,11 @@ Another config could be:
131131

132132
```json
133133
{
134-
"haskell.toolchain": {
135-
"ghc": "9.2.2",
136-
"hls": "latest"
137-
"cabal": "recommended"
138-
}
134+
"haskell.toolchain": {
135+
"ghc": "9.2.2",
136+
"hls": "latest",
137+
"cabal": "recommended"
138+
}
139139
}
140140
```
141141

@@ -151,11 +151,10 @@ The defaults (when omitted) are as follows:
151151
1. install the project required `ghc` (corresponding to `with-compiler` setting in `cabal.project` for example)
152152
2. install the latest `hls` version that supports the project required ghc version
153153
3. install latest `cabal`
154-
3. install latest `stack`
154+
4. install latest `stack`
155155

156156
When a the value is `null`, the extension will refrain from installing it.
157157

158-
159158
### Supported GHC versions
160159

161160
These are the versions of GHC that there are binaries of `haskell-language-server-1.6.1` for. Building from source may support more versions!
@@ -204,18 +203,16 @@ Please include the output when filing any issues on the [haskell-language-server
204203

205204
- Sometimes the language server might get stuck in a rut and stop responding to your latest changes.
206205
Should this occur you can try restarting the language server with <kbd>Ctrl</kbd> <kbd>shift</kbd> <kbd>P</kbd>/<kbd>⌘</kbd> <kbd>shift</kbd> <kbd>P</kbd> > Restart Haskell LSP Server.
207-
206+
208207
#### `Cradle requires ghc/cabal/stack but it isn't installed`
209208

210209
- In Linux/MacOS systems, opening vscode in the windows system could not use the `$PATH` set in the shell
211210
so it will not see required tools as ghc, cabal or stack. This usually happens if you have installed them
212-
via ghcup.
213-
- It could be fixed changing the `$PATH` variable in the init config file used by the windows system
211+
via ghcup.
212+
- It could be fixed changing the `$PATH` variable in the init config file used by the windows system
214213
(f.e. `~/.profile`, but i can vary depending on your system setup).
215214
- See [this stackoverflow question](https://stackoverflow.com/questions/43983718/set-global-path-environment-variable-in-vs-code) for more tricks.
216215

217-
218-
219216
## Contributing
220217

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@
433433
"tslint-fix": "tslint --fix -p tsconfig.json -c tslint.json --format stylish 'src/**/*.ts'",
434434
"push-tag": "git tag -a $npm_package_version -m \"Version $npm_package_version\" && git push origin $npm_package_version",
435435
"pretest": "tsc -p ./",
436+
"format": "prettier . --write",
436437
"test": "node ./out/test/runTest.js"
437438
},
438439
"husky": {
@@ -459,7 +460,7 @@
459460
"glob": "^7.1.4",
460461
"husky": "^7.0.2",
461462
"mocha": "^9.2.1",
462-
"prettier": "^2.5.1",
463+
"prettier": "^2.6.2",
463464
"pretty-quick": "^3.1.2",
464465
"set-value": ">=4.0.1",
465466
"ts-loader": "^9.2.8",

src/commands/importIdentifier.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1+
import * as bent from 'bent';
12
import * as cheerio from 'cheerio';
23
import * as yaml from 'js-yaml';
34
import escapeRegExp from 'lodash-es/escapeRegExp';
45
import * as LRUCache from 'lru-cache';
5-
import * as bent from 'bent';
66
import * as vscode from 'vscode';
77
import { CommandNames } from './constants';
88

99
const getJson = bent('json');
1010

1111
const askHoogle = async (variable: string): Promise<any> => {
12-
return await getJson(
13-
`https://hoogle.haskell.org/?hoogle=${variable}&scope=set%3Astackage&mode=json`
14-
);
12+
return await getJson(`https://hoogle.haskell.org/?hoogle=${variable}&scope=set%3Astackage&mode=json`);
1513
};
1614

1715
const withCache =

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
276276
* Deactivate each of the LSP servers.
277277
*/
278278
export async function deactivate() {
279-
const promises: Array<Thenable<void>> = [];
279+
const promises: Thenable<void>[] = [];
280280
for (const client of clients.values()) {
281281
if (client) {
282282
promises.push(client.stop());

src/hlsBinaries.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,12 @@ export async function findHaskellLanguageServer(
280280
await upgradeGHCup(context, logger);
281281

282282
// boring init
283-
let latestHLS: string | undefined | null = undefined;
284-
let latestCabal: string | undefined | null = undefined;
285-
let latestStack: string | undefined | null = undefined;
283+
let latestHLS: string | undefined | null;
284+
let latestCabal: string | undefined | null;
285+
let latestStack: string | undefined | null;
286286
let recGHC: string | undefined | null = 'recommended';
287-
let projectHls: string | undefined | null = undefined;
288-
let projectGhc: string | undefined | null = undefined;
287+
let projectHls: string | undefined | null;
288+
let projectGhc: string | undefined | null;
289289

290290
// support explicit toolchain config
291291
const toolchainConfig: ToolConfig = new Map(

test/runTest.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ function installExtension(vscodeExePath: string, extId: string) {
1515

1616
async function main() {
1717
try {
18-
const vscodeExecutablePath = await downloadAndUnzipVSCode('stable'
19-
, process.platform === 'win32' ? 'win32-x64-archive' : undefined);
18+
const vscodeExecutablePath = await downloadAndUnzipVSCode(
19+
'stable',
20+
process.platform === 'win32' ? 'win32-x64-archive' : undefined
21+
);
2022

2123
// We have to install this dependant extension
2224
installExtension(vscodeExecutablePath, 'justusadam.language-haskell');

0 commit comments

Comments
 (0)