This commit is contained in:
Benjamin Pasero 2022-02-09 07:24:18 +01:00
parent f613ab462e
commit 2ec520c893
No known key found for this signature in database
GPG key ID: E6380CC4C8219E65
2 changed files with 12 additions and 12 deletions

View file

@ -13,16 +13,6 @@ import { URI, UriComponents } from 'vs/base/common/uri';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
export interface IRawFileWorkspaceFolder {
path: string;
name?: string;
}
export interface IRawUriWorkspaceFolder {
uri: string;
name?: string;
}
export const IWorkspaceContextService = createDecorator<IWorkspaceContextService>('contextService');
export interface IWorkspaceContextService extends IWorkspaceFolderProvider {
@ -372,6 +362,16 @@ export class Workspace implements IWorkspace {
}
}
export interface IRawFileWorkspaceFolder {
path: string;
name?: string;
}
export interface IRawUriWorkspaceFolder {
uri: string;
name?: string;
}
export class WorkspaceFolder implements IWorkspaceFolder {
readonly uri: URI;

View file

@ -111,13 +111,13 @@ export function isStoredWorkspaceFolder(obj: unknown): obj is IStoredWorkspaceFo
return isRawFileWorkspaceFolder(obj) || isRawUriWorkspaceFolder(obj);
}
export function isRawFileWorkspaceFolder(obj: unknown): obj is IRawFileWorkspaceFolder {
function isRawFileWorkspaceFolder(obj: unknown): obj is IRawFileWorkspaceFolder {
const candidate = obj as IRawFileWorkspaceFolder | undefined;
return typeof candidate?.path === 'string' && (!candidate.name || typeof candidate.name === 'string');
}
export function isRawUriWorkspaceFolder(obj: unknown): obj is IRawUriWorkspaceFolder {
function isRawUriWorkspaceFolder(obj: unknown): obj is IRawUriWorkspaceFolder {
const candidate = obj as IRawUriWorkspaceFolder | undefined;
return typeof candidate?.uri === 'string' && (!candidate.name || typeof candidate.name === 'string');