@@ -16,7 +16,7 @@ const logger: Logger = new Logger(`file.utils:`, config.logLevel);
1616export function readDataFile ( dataFilePath : string , encoding :string = null ) {
1717 let data : any = '' ;
1818 const fileName : string = path . basename ( dataFilePath ) ;
19- const fileUri : Uri = Uri . parse ( dataFilePath ) ;
19+ const fileUri : Uri = Uri . file ( dataFilePath ) ; // . parse(dataFilePath);
2020 logger . debug ( 'readDataFile():' , dataFilePath ) ;
2121 if ( ! config . supportedDataFiles . test ( fileName ) ) {
2222 window . showErrorMessage ( `${ dataFilePath } is not a supported data file for Data Preview!` ) ;
@@ -36,7 +36,7 @@ export function readDataFile(dataFilePath: string, encoding:string = null) {
3636 workspace . findFiles ( `**/${ dataFilePath } ` ) . then ( files => {
3737 if ( files . length > 0 && fs . existsSync ( files [ 0 ] . fsPath ) ) {
3838 // read workspace file data
39- data = readLocalData ( dataFilePath , encoding ) ;
39+ data = readLocalData ( files [ 0 ] . fsPath , encoding ) ;
4040 } else {
4141 window . showErrorMessage ( `${ dataFilePath } file doesn't exist!` ) ;
4242 }
@@ -51,7 +51,7 @@ export function readDataFile(dataFilePath: string, encoding:string = null) {
5151 */
5252export function getFileSize ( dataFilePath : string ) : number {
5353 let fileSize : number = - 1 ;
54- const fileUri : Uri = Uri . parse ( dataFilePath ) ;
54+ const fileUri : Uri = Uri . file ( dataFilePath ) ; //. parse(dataFilePath);
5555 if ( fs . existsSync ( fileUri . fsPath ) ) {
5656 const stats : fs . Stats = fs . statSync ( fileUri . fsPath ) ;
5757 fileSize = stats . size ;
0 commit comments