File tree Expand file tree Collapse file tree 2 files changed +0
-59
lines changed
Expand file tree Collapse file tree 2 files changed +0
-59
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import {
1212 LOCAL_CLI_INSTALLATION_DIRNAME ,
1313} from "../constants.ts" ;
1414
15- import { execLocalStack } from "./cli.ts" ;
1615import { exec } from "./exec.ts" ;
1716import { minDelay } from "./promises.ts" ;
1817import {
@@ -23,18 +22,6 @@ import {
2322import { spawn } from "./spawn.ts" ;
2423import type { Telemetry } from "./telemetry.ts" ;
2524
26- // export async function checkLocalstackInstalled(
27- // cliPath: string|undefined,
28- // outputChannel: LogOutputChannel,
29- // ): Promise<boolean> {
30- // try {
31- // await execLocalStack(cliPath, ["--version"], { outputChannel });
32- // return true;
33- // } catch (error) {
34- // return false;
35- // }
36- // }
37-
3825export interface RunInstallProcessOptions {
3926 progress : Progress < { message : string } > ;
4027 cancellationToken : CancellationToken ;
Original file line number Diff line number Diff line change 11import pMinDelay from "p-min-delay" ;
2- import type { Disposable } from "vscode" ;
32
43/**
54 * Setting up a minimum wait time allows users
@@ -33,48 +32,3 @@ export function minDelay<T>(
3332 MIN_TIME_BETWEEN_STEPS_MS ,
3433 ) ;
3534}
36-
37- /**
38- * Extracts the resolved type from a Promise.
39- */
40- export type UnwrapPromise < T > = T extends Promise < infer U > ? U : T ;
41-
42- export function setIntervalPromise (
43- callback : ( ) => Promise < void > ,
44- intervalMs : number ,
45- ) : Disposable {
46- let timeout : NodeJS . Timeout | undefined ;
47- let disposed = false ;
48-
49- const runLater = ( ) => {
50- timeout = setTimeout ( ( ) => void run ( ) , intervalMs ) ;
51- } ;
52-
53- const run = async ( ) => {
54- if ( disposed ) {
55- return ;
56- }
57-
58- try {
59- await callback ( ) ;
60- } catch {
61- // Ignore errors
62- } finally {
63- if ( ! disposed ) {
64- runLater ( ) ;
65- }
66- }
67- } ;
68-
69- runLater ( ) ;
70-
71- return {
72- dispose : ( ) => {
73- disposed = true ;
74- if ( timeout ) {
75- clearTimeout ( timeout ) ;
76- timeout = undefined ;
77- }
78- } ,
79- } ;
80- }
You can’t perform that action at this time.
0 commit comments