55
66import { UserCancelledError , type IActionContext , type IAzureQuickPickItem } from "@microsoft/vscode-azext-utils" ;
77import { basename } from "path" ;
8- import { window , workspace , type OpenDialogOptions , type Uri , type WorkspaceFolder } from "vscode" ;
8+ import { Uri , window , workspace , type OpenDialogOptions , type WorkspaceFolder } from "vscode" ;
99import { browseItem , dockerfileGlobPattern , envFileGlobPattern } from "../constants" ;
1010import { type SetTelemetryProps } from "../telemetry/SetTelemetryProps" ;
1111import { type WorkspaceFileTelemetryProps as TelemetryProps } from "../telemetry/WorkspaceFileTelemetryProps" ;
@@ -55,14 +55,14 @@ export async function selectWorkspaceFile(
5555 }
5656
5757 if ( options . autoSelectIfOne && files . length === 1 ) {
58- return files [ 0 ] . path ;
58+ return files [ 0 ] . fsPath ;
5959 }
6060
6161 quickPicks . push ( ...files . map ( ( uri : Uri ) => {
6262 return {
6363 label : basename ( uri . path ) ,
6464 description : uri . path ,
65- data : uri . path
65+ data : uri . fsPath
6666 } ;
6767 } ) ) ;
6868
@@ -82,7 +82,7 @@ export async function selectWorkspaceFile(
8282 if ( input ?. data === skipForNow ) {
8383 return undefined ;
8484 } else {
85- return input ?. data || ( await context . ui . showOpenDialog ( options ) ) [ 0 ] . path ;
85+ return input ?. data || ( await context . ui . showOpenDialog ( options ) ) [ 0 ] . fsPath ;
8686 }
8787}
8888
@@ -101,5 +101,5 @@ export async function getRootWorkspaceFolder(placeHolder?: string): Promise<Work
101101}
102102
103103export function getWorkspaceFolderFromPath ( path : string ) : WorkspaceFolder | undefined {
104- return workspace . workspaceFolders ?. find ( folder => folder . uri . path === path ) ;
104+ return workspace . workspaceFolders ?. find ( folder => folder . uri . fsPath === Uri . file ( path ) . fsPath ) ;
105105}
0 commit comments