@@ -15,12 +15,29 @@ const REMOTE_PATH_SERVICE_ID = 'remotePath';
1515export const IRemotePathService = createDecorator < IRemotePathService > ( REMOTE_PATH_SERVICE_ID ) ;
1616
1717export interface IRemotePathService {
18+
1819 _serviceBrand : undefined ;
1920
21+ /**
22+ * The path library to use for the target remote environment.
23+ */
2024 readonly path : Promise < path . IPath > ;
25+
26+ /**
27+ * Converts the given path to a file URI in the remote environment.
28+ */
2129 fileURI ( path : string ) : Promise < URI > ;
2230
31+ /**
32+ * Resolves the user home of the remote environment if defined.
33+ */
2334 readonly userHome : Promise < URI > ;
35+
36+ /**
37+ * Provides access to the user home of the remote environment
38+ * if defined.
39+ */
40+ readonly userHomeSync : URI | undefined ;
2441}
2542
2643/**
@@ -30,12 +47,15 @@ export class RemotePathService implements IRemotePathService {
3047 _serviceBrand : undefined ;
3148
3249 private _extHostOS : Promise < platform . OperatingSystem > ;
50+ private _userHomeSync : URI | undefined ;
3351
3452 constructor (
3553 @IRemoteAgentService private readonly remoteAgentService : IRemoteAgentService ,
3654 @IWorkbenchEnvironmentService private readonly environmentService : IWorkbenchEnvironmentService
3755 ) {
3856 this . _extHostOS = remoteAgentService . getEnvironment ( ) . then ( remoteEnvironment => {
57+ this . _userHomeSync = remoteEnvironment ?. userHome ;
58+
3959 return remoteEnvironment ? remoteEnvironment . os : platform . OS ;
4060 } ) ;
4161 }
@@ -93,6 +113,10 @@ export class RemotePathService implements IRemotePathService {
93113 return this . environmentService . userHome ! ;
94114 } ) ;
95115 }
116+
117+ get userHomeSync ( ) : URI | undefined {
118+ return this . _userHomeSync || this . environmentService . userHome ;
119+ }
96120}
97121
98122registerSingleton ( IRemotePathService , RemotePathService , true ) ;
0 commit comments