Skip to content

Commit 94d146c

Browse files
committed
Fix some new ts errors/warnings
1 parent 1550d44 commit 94d146c

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/docsBrowser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export namespace DocsBrowser {
6565
</body>
6666
</html>
6767
`;
68-
} catch (e) {
68+
} catch (e: any) {
6969
await window.showErrorMessage(e);
7070
}
7171
return panel;
@@ -89,7 +89,7 @@ export namespace DocsBrowser {
8989
if (inWebView) {
9090
await commands.executeCommand('workbench.action.closeActiveEditor');
9191
}
92-
} catch (e) {
92+
} catch (e: any) {
9393
await window.showErrorMessage(e);
9494
}
9595
}

src/hlsBinaries.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,21 +211,21 @@ async function getLatestReleaseMetadata(context: ExtensionContext, storagePath:
211211
: undefined;
212212
const opts: https.RequestOptions = releasesUrl
213213
? {
214-
host: releasesUrl.host,
215-
path: releasesUrl.path,
216-
}
214+
host: releasesUrl.host,
215+
path: releasesUrl.path,
216+
}
217217
: {
218-
host: 'api.github.com',
219-
path: '/repos/haskell/haskell-language-server/releases',
220-
};
218+
host: 'api.github.com',
219+
path: '/repos/haskell/haskell-language-server/releases',
220+
};
221221

222222
const offlineCache = path.join(storagePath, 'latestApprovedRelease.cache.json');
223223

224224
async function readCachedReleaseData(): Promise<IRelease | null> {
225225
try {
226226
const cachedInfo = await promisify(fs.readFile)(offlineCache, { encoding: 'utf-8' });
227227
return validate.parseAndValidate(cachedInfo, cachedReleaseValidator);
228-
} catch (err) {
228+
} catch (err: any) {
229229
// If file doesn't exist, return null, otherwise consider it a failure
230230
if (err.code === 'ENOENT') {
231231
return null;
@@ -268,7 +268,7 @@ async function getLatestReleaseMetadata(context: ExtensionContext, storagePath:
268268
// Cache the latest successfully fetched release information
269269
await promisify(fs.writeFile)(offlineCache, JSON.stringify(latestInfoParsed), { encoding: 'utf-8' });
270270
return latestInfoParsed;
271-
} catch (githubError) {
271+
} catch (githubError: any) {
272272
// Attempt to read from the latest cached file
273273
try {
274274
const cachedInfoParsed = await readCachedReleaseData();

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export async function downloadFile(titleMsg: string, src: string, dest: string):
233233
inFlightDownloads.set(src, new Map([[dest, downloadTask]]));
234234
}
235235
return await downloadTask;
236-
} catch (e) {
236+
} catch (e: any) {
237237
await promisify(fs.unlink)(downloadDest).catch(ignoreFileNotExists);
238238
throw new Error(`Failed to download ${src}:\n${e.message}`);
239239
}

0 commit comments

Comments
 (0)