Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WorkspaceService

The workspace service.

Hierarchy

  • WorkspaceService

Implements

  • FrontendApplicationContribution

Index

Constructors

constructor

Properties

Protected _ready

_ready: Deferred<void> = ...

Protected _roots

_roots: FileStat[] = []

Protected _workspace

_workspace: undefined | FileStat

Protected applicationName

applicationName: string

Protected deferredRoots

deferredRoots: Deferred<FileStat[]> = ...

Protected Readonly envVariableServer

envVariableServer: EnvVariablesServer

Protected Readonly fileService

fileService: FileService

Protected Readonly fsPreferences

fsPreferences: PreferenceProxy<FileSystemConfiguration>

Protected Readonly labelProvider

labelProvider: LabelProvider

Protected logger

logger: ILogger

Protected Readonly messageService

messageService: MessageService

Protected Readonly onWorkspaceChangeEmitter

onWorkspaceChangeEmitter: Emitter<FileStat[]> = ...

Protected Readonly onWorkspaceLocationChangedEmitter

onWorkspaceLocationChangedEmitter: Emitter<undefined | FileStat> = ...

Protected Readonly preferenceImpl

preferenceImpl: PreferenceServiceImpl

Protected preferences

preferences: PreferenceProxy<WorkspaceConfiguration>

Protected Readonly rootWatchers

rootWatchers: Map<string, Disposable> = ...

Protected Readonly schemaProvider

schemaProvider: PreferenceSchemaProvider

Protected Readonly schemaUpdater

schemaUpdater: WorkspaceSchemaUpdater

Protected Readonly server

Protected Readonly toDisposeOnWorkspace

toDisposeOnWorkspace: DisposableCollection = ...

Protected Readonly windowService

windowService: WindowService

Accessors

isMultiRootWorkspaceEnabled

  • get isMultiRootWorkspaceEnabled(): boolean

isMultiRootWorkspaceOpened

  • get isMultiRootWorkspaceOpened(): boolean

onWorkspaceChanged

  • get onWorkspaceChanged(): Event<FileStat[]>

onWorkspaceLocationChanged

  • get onWorkspaceLocationChanged(): Event<undefined | FileStat>

opened

  • get opened(): boolean

ready

  • get ready(): Promise<void>

roots

  • get roots(): Promise<FileStat[]>

saved

  • get saved(): boolean

workspace

  • get workspace(): undefined | FileStat

Methods

addRoot

  • addRoot(uris: default | default[]): Promise<void>

areWorkspaceRoots

  • areWorkspaceRoots(uris: default[]): boolean

close

  • close(): Promise<void>

Protected computeRoots

  • computeRoots(): Promise<FileStat[]>

containsSome

  • containsSome(paths: string[]): Promise<boolean>
  • Return true if one of the paths in paths array is present in the workspace NOTE: You should always explicitly use / as the separator between the path segments.

    Parameters

    • paths: string[]

    Returns Promise<boolean>

Protected doGetDefaultWorkspaceUri

  • doGetDefaultWorkspaceUri(): Promise<undefined | string>

Protected doOpen

Protected formatTitle

  • formatTitle(title?: string): string

Protected getDefaultWorkspacePath

  • getDefaultWorkspacePath(): MaybePromise<undefined | string>

Protected getDefaultWorkspaceUri

  • getDefaultWorkspaceUri(): MaybePromise<undefined | string>
  • Resolves to the default workspace URI as string.

    The default implementation tries to extract the default workspace location from the window.location.hash, then falls-back to the most recently used workspace root from the server.

    It is not ensured that the resolved workspace URI is valid, it can point to a non-existing location.

    Returns MaybePromise<undefined | string>

Protected getExcludes

  • getExcludes(uri: string): string[]

getUntitledWorkspace

  • getUntitledWorkspace(): Promise<default>

Protected getWorkspaceDataFromFile

getWorkspaceRootUri

  • getWorkspaceRootUri(uri: undefined | default): undefined | default
  • Returns the workspace root uri that the given file belongs to. In case that the file is found in more than one workspace roots, returns the root that is closest to the file. If the file is not from the current workspace, returns undefined.

    Parameters

    • uri: undefined | default

      URI of the file

    Returns undefined | default

Protected init

  • init(): Promise<void>

Protected isWorkspaceFile

  • isWorkspaceFile(fileStat: FileStat): boolean

onStop

  • onStop(): void

open

Protected openNewWindow

  • openNewWindow(workspacePath: string): void

Protected openWindow

recentWorkspaces

  • recentWorkspaces(): Promise<string[]>

Protected refreshRootWatchers

  • refreshRootWatchers(): Promise<void>

Protected reloadWindow

  • reloadWindow(): void

removeRoots

  • removeRoots(uris: default[]): Promise<void>

save

  • save(uri: default | FileStat): Promise<void>

Protected setURLFragment

  • setURLFragment(workspacePath: string): void

Protected setWorkspace

  • setWorkspace(workspaceStat: undefined | FileStat): Promise<void>

Protected shouldPreserveWindow

spliceRoots

  • spliceRoots(start: number, deleteCount?: number, ...rootsToAdd: default[]): Promise<default[]>

Protected toFileStat

  • toFileStat(uri: undefined | string | default): Promise<undefined | FileStat>

Protected toValidRoot

  • toValidRoot(uri: undefined | string | default): Promise<undefined | FileStat>

tryGetRoots

  • tryGetRoots(): FileStat[]

Protected updateRoots

  • updateRoots(): Promise<void>

updateSchema

  • updateSchema(key: string, schema?: IJSONSchema): Promise<boolean>
  • Parameters

    • key: string

      the property key under which to store the schema (e.g. tasks, launch)

    • Optional schema: IJSONSchema

      the schema for the property. If none is supplied, the update is treated as a deletion.

    Returns Promise<boolean>

Protected updateTitle

  • updateTitle(): void

Protected updateWorkspace

  • updateWorkspace(): Promise<void>

Protected watchRoot

  • watchRoot(root: FileStat): Promise<void>

Protected watchRoots

  • watchRoots(): Promise<void>

Protected writeWorkspaceFile

  • writeWorkspaceFile(workspaceFile: undefined | FileStat, workspaceData: WorkspaceData): Promise<undefined | FileStat>