diff --git a/src/pageobjects/editor/TextEditor.ts b/src/pageobjects/editor/TextEditor.ts index 363e761d..1fa77a36 100644 --- a/src/pageobjects/editor/TextEditor.ts +++ b/src/pageobjects/editor/TextEditor.ts @@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url' import clipboard from 'clipboardy' import { Key, ChainablePromiseElement } from 'webdriverio' +import logger from '@wdio/logger' import { ContentAssist, ContextMenu, InputBox } from '../index.js' import { StatusBar } from '../statusBar/StatusBar.js' import { Editor, EditorLocators } from './Editor.js' @@ -15,6 +16,8 @@ import { } from '../../locators/1.73.0.js' import { CMD_KEY } from '../../constants.js' +const log = logger('wdio-vscode-service') + export interface TextEditor extends IPageDecorator {} /** * Page object representing the active text editor @@ -370,7 +373,7 @@ export class TextEditor extends Editor { try { await menu.select('Format Document') } catch (err) { - console.log('Warn: Format Document not available for selected language') + log.error('Warn: Format Document not available for selected language') if (await menu.elem.isDisplayed()) { await menu.close() } diff --git a/src/pageobjects/menu/WindowControls.ts b/src/pageobjects/menu/WindowControls.ts index f825fa77..774ee607 100644 --- a/src/pageobjects/menu/WindowControls.ts +++ b/src/pageobjects/menu/WindowControls.ts @@ -1,11 +1,14 @@ import type { ChainablePromiseElement } from 'webdriverio' +import logger from '@wdio/logger' import { PageDecorator, IPageDecorator, BasePage, VSCodeLocatorMap } from '../utils.js' import { TitleBar } from '../../index.js' import { WindowControls as WindowControlsLocators } from '../../locators/1.73.0.js' +const log = logger('wdio-vscode-service') + export interface WindowControls extends IPageDecorator {} /** * Page object for the windows controls part of the title bar @@ -44,7 +47,7 @@ export class WindowControls extends BasePage { try { await this.maximize$.click() } catch (err) { - console.log('Window is already maximized') + log.error('Window is already maximized', err) } } @@ -56,7 +59,7 @@ export class WindowControls extends BasePage { try { await this.restore$.click() } catch (err) { - console.log('Window is not maximized') + log.error('Window is not maximized', err) } } diff --git a/src/server/utils.ts b/src/server/utils.ts index bc719d79..795844ea 100644 --- a/src/server/utils.ts +++ b/src/server/utils.ts @@ -3,7 +3,8 @@ import path from 'node:path' import { fsProviderExtensionPrefix, fsProviderFolderUri } from './constants.js' -const { URI } = (await import('vscode-uri')).default +const vscodeUri = await import('vscode-uri') +const { URI } = vscodeUri.default ? vscodeUri.default : vscodeUri export interface IConfig { readonly extensionPaths: string[] | undefined