File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 55import * as vscode from "vscode" ;
66import * as config from "./Config" ;
77
8+ const localPath = getUriFilePath ( config . localWorkspacePath ) ;
9+ const remotePath = getUriFilePath ( config . remoteWorkspacePath ) ;
10+
11+ function getUriFilePath ( path : string | undefined ) : string {
12+ return path ? vscode . Uri . file ( path ) . toString ( ) : '' ;
13+ }
14+
815/**
916 * Converts a local workspace URI to a file path string (with or without scheme) to pass to
1017 * the typechecker. Path is mapped to an alternate workspace root if configured.
@@ -17,7 +24,7 @@ export const mapFromWorkspaceUri = (file: vscode.Uri): string => {
1724 }
1825 return file
1926 . toString ( )
20- . replace ( config . localWorkspacePath , config . remoteWorkspacePath ) ;
27+ . replace ( localPath , remotePath ) ;
2128} ;
2229
2330/**
@@ -29,8 +36,8 @@ export const mapToWorkspaceUri = (file: string): vscode.Uri => {
2936 let filePath = file ;
3037 if ( config . remoteEnabled && config . remoteWorkspacePath ) {
3138 filePath = filePath . replace (
32- config . remoteWorkspacePath ,
33- config . localWorkspacePath
39+ remotePath ,
40+ localPath
3441 ) ;
3542 }
3643 if ( filePath . startsWith ( "file://" ) ) {
You can’t perform that action at this time.
0 commit comments