mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 11:10:48 +00:00
💄
This commit is contained in:
parent
f613ab462e
commit
2ec520c893
2 changed files with 12 additions and 12 deletions
|
@ -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;
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue