The workspace service.

Implements

Constructors

Properties

_ready: Deferred<void> = ...
_roots: FileStat[] = []
_workspace: undefined | FileStat
deferredRoots: Deferred<FileStat[]> = ...
envVariableServer: EnvVariablesServer
fileService: FileService
fsPreferences: FileSystemPreferences
labelProvider: LabelProvider
logger: ILogger
messageService: MessageService
onWorkspaceChangeEmitter: Emitter<FileStat[]> = ...
onWorkspaceLocationChangedEmitter: Emitter<undefined | FileStat> = ...
openHandlerContribution: ContributionProvider<WorkspaceOpenHandlerContribution>
preferenceImpl: PreferenceServiceImpl
rootWatchers: Map<string, Disposable> = ...
schemaProvider: PreferenceSchemaProvider
schemaUpdater: WorkspaceSchemaUpdater
toDisposeOnWorkspace: DisposableCollection = ...
untitledWorkspaceService: UntitledWorkspaceService
windowService: WindowService
windowTitleService: WindowTitleService
workspaceFileService: WorkspaceFileService

Accessors

Methods

  • 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>

  • 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>

  • 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 | URI

      URI of the file

    Returns undefined | URI

  • Check if the file should be considered as a workspace file.

    Example: We should not try to read the contents of an .exe file.

    Parameters

    • candidate: URI | FileStat

    Returns boolean

  • returns a FileStat if the argument URI points to a file or directory. Otherwise, undefined.

    Parameters

    • uri: undefined | string | URI

    Returns Promise<undefined | FileStat>

  • returns a FileStat if the argument URI points to an existing directory. Otherwise, undefined.

    Parameters

    • uri: undefined | string | URI

    Returns Promise<undefined | FileStat>

  • 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>