Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix for import('vscode-uri').default #92

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/pageobjects/editor/TextEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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<EditorLocators> {}
/**
* Page object representing the active text editor
Expand Down Expand Up @@ -370,7 +373,7 @@ export class TextEditor extends Editor<EditorLocators> {
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()
}
Expand Down
7 changes: 5 additions & 2 deletions src/pageobjects/menu/WindowControls.ts
Original file line number Diff line number Diff line change
@@ -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<typeof WindowControlsLocators> {}
/**
* Page object for the windows controls part of the title bar
Expand Down Expand Up @@ -44,7 +47,7 @@ export class WindowControls extends BasePage<typeof WindowControlsLocators> {
try {
await this.maximize$.click()
} catch (err) {
console.log('Window is already maximized')
log.error('Window is already maximized', err)
}
}

Expand All @@ -56,7 +59,7 @@ export class WindowControls extends BasePage<typeof WindowControlsLocators> {
try {
await this.restore$.click()
} catch (err) {
console.log('Window is not maximized')
log.error('Window is not maximized', err)
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/server/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down