mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
paths - allow to get at local userHome folder
This commit is contained in:
@@ -40,9 +40,10 @@ export interface IPathService {
|
||||
/**
|
||||
* Resolves the user-home directory for the target environment.
|
||||
* If the envrionment is connected to a remote, this will be the
|
||||
* remote's user home directory, otherwise the local one.
|
||||
* remote's user home directory, otherwise the local one unless
|
||||
* `preferLocal` is set to `true`.
|
||||
*/
|
||||
readonly userHome: Promise<URI>;
|
||||
userHome(options?: { preferLocal: boolean }): Promise<URI>;
|
||||
|
||||
/**
|
||||
* @deprecated use `userHome` instead.
|
||||
@@ -60,7 +61,7 @@ export abstract class AbstractPathService implements IPathService {
|
||||
private maybeUnresolvedUserHome: URI | undefined;
|
||||
|
||||
constructor(
|
||||
localUserHome: URI,
|
||||
private localUserHome: URI,
|
||||
@IRemoteAgentService private readonly remoteAgentService: IRemoteAgentService
|
||||
) {
|
||||
|
||||
@@ -81,8 +82,8 @@ export abstract class AbstractPathService implements IPathService {
|
||||
})();
|
||||
}
|
||||
|
||||
get userHome(): Promise<URI> {
|
||||
return this.resolveUserHome;
|
||||
async userHome(options?: { preferLocal: boolean }): Promise<URI> {
|
||||
return options?.preferLocal ? this.localUserHome : this.resolveUserHome;
|
||||
}
|
||||
|
||||
get resolvedUserHome(): URI | undefined {
|
||||
|
||||
Reference in New Issue
Block a user