/**
 * Utility functions to help with file path parsing and others
 */ import * as vscode from "vscode" ; import * as config from "./Config" ; param file param includeScheme export const mapFromWorkspaceUri = ( file ) : string => { if ( ! config . remoteEnabled || ! config . remoteWorkspacePath ) { return file . toString ( ) ; } return file . toString ( ) . replace ( config . localWorkspacePath , config . remoteWorkspacePath ) ; } ; param file export const mapToWorkspaceUri = ( file ) : vscode . Uri => { let filePath = file ; if ( config . remoteEnabled && config . remoteWorkspacePath ) { filePath = filePath . replace ( config . remoteWorkspacePath , config . localWorkspacePath ) ; } if ( filePath . startsWith ( "file://" ) ) { return vscode . Uri . parse ( filePath ) ; } else { return vscode . Uri . file ( filePath ) ; } } ;