Skip to content

Commit 315f42d

Browse files
committed
Add Release Info Path In Setting
(cherry picked from commit c53475b)
1 parent 93e7b58 commit 315f42d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@
146146
"default": "haskell-language-server",
147147
"description": "Which language server to use."
148148
},
149+
"haskell.languageServerReleasesPath": {
150+
"scope": "resource",
151+
"type": "string",
152+
"default": "https://api.github.com/repos/haskell/haskell-language-server/releases",
153+
"description": "a path to a json file"
154+
},
149155
"haskell.serverExecutablePath": {
150156
"scope": "resource",
151157
"type": "string",
@@ -229,4 +235,4 @@
229235
"vscode-languageclient": "6.1.3",
230236
"yauzl": "^2.10.0"
231237
}
232-
}
238+
}

src/hlsBinaries.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as fs from 'fs';
33
import * as https from 'https';
44
import * as os from 'os';
55
import * as path from 'path';
6+
import * as url from 'url';
67
import { promisify } from 'util';
78
import { env, ExtensionContext, ProgressLocation, Uri, window, workspace, WorkspaceFolder } from 'vscode';
89
import { downloadFile, executableExists, httpsGetSilently } from './utils';
@@ -160,9 +161,10 @@ async function getProjectGhcVersion(context: ExtensionContext, dir: string, rele
160161
}
161162

162163
async function getLatestReleaseMetadata(context: ExtensionContext): Promise<IRelease | null> {
164+
const releasesUrl = url.parse(workspace.getConfiguration('haskell').languageServerReleasesPath);
163165
const opts: https.RequestOptions = {
164-
host: 'api.github.com',
165-
path: '/repos/haskell/haskell-language-server/releases',
166+
host: releasesUrl.host,
167+
path: releasesUrl.path,
166168
};
167169

168170
const offlineCache = path.join(context.globalStoragePath, 'latestApprovedRelease.cache.json');

0 commit comments

Comments
 (0)