Skip to content

Commit

Permalink
chore: remove sleep util
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanders11 committed Nov 12, 2024
1 parent 091d3f3 commit 340d683
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/commands/configs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as childProcess from "node:child_process";
import * as path from "node:path";
import { setTimeout } from "node:timers/promises";
import { promisify } from "node:util";

import * as vscode from "vscode";
Expand All @@ -11,7 +12,7 @@ import {
ExtensionOperation,
} from "../extensionState";
import Logger from "../logging";
import { getConfigsFilePath, sleep } from "../utils";
import { getConfigsFilePath } from "../utils";
import type {
ConfigCollector,
ConfigTreeItem,
Expand Down Expand Up @@ -318,7 +319,7 @@ export function registerConfigsCommands(
},
async (value: { label: string } | string | undefined) => {
if (value === undefined) {
await sleep(50); // If this is too fast it has an ugly flash in VS Code
await setTimeout(50); // If this is too fast it has an ugly flash in VS Code
const { configs, activeConfig } = await configsCollector.getConfigs();
value = await vscode.window.showQuickPick<vscode.QuickPickItem>(
configs.map((config) => ({
Expand Down
4 changes: 0 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -722,10 +722,6 @@ export async function drillDown(
throw new Error("Drill down tried to continue, but no children of item");
}

export function sleep(timeMs: number) {
return new Promise((resolve) => setTimeout(resolve, timeMs));
}

export function positionAt(content: string, offset: number) {
const lines = Array.from(
content.slice(0, offset).matchAll(/^(.*)(?:\r\n|$)/gm),
Expand Down

0 comments on commit 340d683

Please sign in to comment.