Skip to content

Commit 739a6a7

Browse files
committed
Update languageServerReleasesPath to default blank
(cherry picked from commit 2d83281)
1 parent 99f0e8c commit 739a6a7

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
"haskell.languageServerReleasesPath": {
150150
"scope": "resource",
151151
"type": "string",
152-
"default": "https://api.github.com/repos/haskell/haskell-language-server/releases",
152+
"default": "",
153153
"description": "An optional path to override where to check for haskell-language-server releases"
154154
},
155155
"haskell.serverExecutablePath": {

src/hlsBinaries.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,18 @@ async function getProjectGhcVersion(context: ExtensionContext, dir: string, rele
161161
}
162162

163163
async function getLatestReleaseMetadata(context: ExtensionContext): Promise<IRelease | null> {
164-
const releasesUrl = url.parse(workspace.getConfiguration('haskell').languageServerReleasesPath);
165-
const opts: https.RequestOptions = {
166-
host: releasesUrl.host,
167-
path: releasesUrl.path,
168-
};
164+
const releasesUrl = workspace.getConfiguration('haskell').languageServerReleasesPath
165+
? url.parse(workspace.getConfiguration('haskell').languageServerReleasesPath)
166+
: undefined;
167+
const opts: https.RequestOptions = releasesUrl
168+
? {
169+
host: releasesUrl.host,
170+
path: releasesUrl.path,
171+
}
172+
: {
173+
host: 'api.github.com',
174+
path: '/repos/haskell/haskell-language-server/releases',
175+
};
169176

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

0 commit comments

Comments
 (0)