diff --git a/vscode-lean4/src/leanclient.ts b/vscode-lean4/src/leanclient.ts index 48dbb2515..f579fc61e 100644 --- a/vscode-lean4/src/leanclient.ts +++ b/vscode-lean4/src/leanclient.ts @@ -48,7 +48,7 @@ import { displayNotificationWithOutput, } from './utils/notifs' import { willUseLakeServer } from './utils/projectInfo' -import path = require('path') +import path from 'path' const escapeRegExp = (s: string) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') diff --git a/vscode-lean4/src/projectinit.ts b/vscode-lean4/src/projectinit.ts index 9fbd84a0b..a8d41cf44 100644 --- a/vscode-lean4/src/projectinit.ts +++ b/vscode-lean4/src/projectinit.ts @@ -13,7 +13,7 @@ import { lake } from './utils/lake' import { LeanInstaller } from './utils/leanInstaller' import { displayNotification, displayNotificationWithInput } from './utils/notifs' import { checkParentFoldersForLeanProject, isValidLeanProject } from './utils/projectInfo' -import path = require('path') +import path from 'path' const projectInitNotificationOptions: SetupNotificationOptions = { errorMode: { mode: 'NonModal' }, diff --git a/vscode-lean4/src/utils/fsHelper.ts b/vscode-lean4/src/utils/fsHelper.ts index 0efd93982..9b2ee7c5e 100644 --- a/vscode-lean4/src/utils/fsHelper.ts +++ b/vscode-lean4/src/utils/fsHelper.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import { PathLike, promises } from 'fs' -import path = require('path') +import path from 'path' /** * Returns true if `pathFile` exists and is a file diff --git a/vscode-lean4/src/utils/projectInfo.ts b/vscode-lean4/src/utils/projectInfo.ts index 136a7e70c..d4e3a5fb9 100644 --- a/vscode-lean4/src/utils/projectInfo.ts +++ b/vscode-lean4/src/utils/projectInfo.ts @@ -1,7 +1,7 @@ import * as fs from 'fs' import { ExtUri, FileUri, getWorkspaceFolderUri } from './exturi' import { dirExists, fileExists } from './fsHelper' -import path = require('path') +import path from 'path' // Detect lean4 root directory (works for both lean4 repo and nightly distribution) diff --git a/vscode-lean4/test/suite/utils/helpers.ts b/vscode-lean4/test/suite/utils/helpers.ts index ba5c09817..14c5db816 100644 --- a/vscode-lean4/test/suite/utils/helpers.ts +++ b/vscode-lean4/test/suite/utils/helpers.ts @@ -1,14 +1,13 @@ import assert from 'assert' import * as fs from 'fs' import * as os from 'os' -import { basename, join } from 'path' +import path, { basename, join } from 'path' import * as vscode from 'vscode' import { AlwaysEnabledFeatures, EnabledFeatures, Exports } from '../../../src/exports' import { InfoProvider } from '../../../src/infoview' import { LeanClient } from '../../../src/leanclient' import { LeanClientProvider } from '../../../src/utils/clientProvider' import { logger } from '../../../src/utils/logger' -import path = require('path') export function sleep(ms: number) { return new Promise(resolve => setTimeout(resolve, ms))