MCPcopy Create free account
hub / github.com/Botloader/botloader / updateTypeDecls

Function updateTypeDecls

botloader-vscode/src/extension.ts:279–296  ·  view source on GitHub ↗
(context: vscode.ExtensionContext)

Source from the content-addressed store, hash-verified

277// the extentionUri is version specific so we can't reference it in tsconfig's
278// (also in the future we might want to downlaod typedecls from)
279async function updateTypeDecls(context: vscode.ExtensionContext) {
280 const typingsUriGlobal = vscode.Uri.joinPath(context.globalStorageUri, "/typings");
281 try {
282 // clear the typings folder first
283 await vscode.workspace.fs.delete(typingsUriGlobal, {
284 recursive: true,
285 useTrash: false,
286 });
287 } catch { }
288 await vscode.workspace.fs.createDirectory(typingsUriGlobal);
289
290 await downloadTypeDecls(context);
291
292 // const extensionTypings = vscode.Uri.joinPath(context.extensionUri, "/out/typings");
293 // // await vscode.workspace.fs.createDirectory(typingsUriGlobal);
294 // await vscode.workspace.fs.copy(extensionTypings, typingsUriGlobal);
295 // console.log(typingsUriGlobal);
296}
297
298async function downloadTypeDecls(context: vscode.ExtensionContext): Promise<void> {
299 const config = vscode.workspace.getConfiguration("botloader");

Callers 1

activateFunction · 0.85

Calls 2

downloadTypeDeclsFunction · 0.70
deleteMethod · 0.45

Tested by

no test coverage detected