Options
All
  • Public
  • Public/Protected
  • All
Menu

Handles a workspace.

Hierarchy

Index

Constructors

constructor

Properties

Protected Readonly _DISPOSABLES

_DISPOSABLES: Disposable[]

Stores disposable sub objects.

Protected Readonly _INTERVALS

_INTERVALS: Timer[]

Stores intervals.

Private Readonly _QUEUE

_QUEUE: default<default, DefaultAddOptions> = ...

Protected Readonly _TIMEOUTS

_TIMEOUTS: Timer[]

Stores timeouts.

Private _configSrc

Private _isInitialized

_isInitialized: boolean = false

Private _scriptStates

_scriptStates: FileStateStorage

Private _settings

Readonly context

Readonly folder

folder: WorkspaceFolder

Readonly id

id: number

Readonly instanceState

instanceState: {} = {}

A key/value pair for data for that instance.

Type declaration

  • [key: string]: any

Static Readonly captureRejectionSymbol

captureRejectionSymbol: typeof captureRejectionSymbol

Static captureRejections

captureRejections: boolean

Sets or gets the default captureRejection value for all emitters.

Static defaultMaxListeners

defaultMaxListeners: number

Static Readonly errorMonitor

errorMonitor: typeof errorMonitor

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted, therefore the process will still crash if no regular 'error' listener is installed.

Accessors

configSource

isDisposed

  • get isDisposed(): boolean
  • Gets if object has been disposed or not.

    Returns boolean

isDisposing

  • get isDisposing(): boolean
  • Gets if the 'dispose()' method is currently executed or not.

    Returns boolean

isInFinalizeState

  • get isInFinalizeState(): boolean
  • Gets if the object is disposed or currently disposing.

    Returns boolean

isInitialized

  • get isInitialized(): boolean

logger

output

  • get output(): OutputChannel

rootPath

  • get rootPath(): string
  • inheritdoc

    Returns string

scriptStates

settings

Methods

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): Workspace
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Workspace

Protected cleanupIntervals

  • cleanupIntervals(): void
  • Cleansup all timeouts.

    Returns void

Protected cleanupTimeouts

  • cleanupTimeouts(): void
  • Cleansup all timeouts.

    Returns void

dispose

  • dispose(): void
  • inheritdoc

    Returns void

doesMatchFilterCondition

  • Checks if a conditional object does match items condition.

    Parameters

    Returns boolean

    Matches condition or not.

doesMatchPlatformCondition

  • Checks if a platform object does match the (current) platform.

    Parameters

    Returns boolean

    Matches condition or not.

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

executeCode

  • executeCode(code: string, values?: Value | Value[]): any
  • Executes code for that workspace.

    Parameters

    • code: string

      The code to execute.

    • Optional values: Value | Value[]

    Returns any

    The result of the execution.

executeOnEditorChangedEvents

  • executeOnEditorChangedEvents<TObj>(objs: TObj | TObj[], codeExecutor?: (code: string, obj: TObj) => any): void
  • Executes the code in 'onEditorChanged' of an object for that workspace.

    Type parameters

    Parameters

    • objs: TObj | TObj[]

      One or more objects.

    • Optional codeExecutor: (code: string, obj: TObj) => any

      A custom code executor.

        • (code: string, obj: TObj): any
        • Parameters

          • code: string
          • obj: TObj

          Returns any

    Returns void

executeScript

  • executeScript<TArgs, TSettings>(settings: TSettings, argsFactory: (args: TArgs, settings: TSettings) => TArgs | PromiseLike<TArgs>): Promise<any>
  • Executes a script.

    Type parameters

    Parameters

    • settings: TSettings

      The object with the settings.

    • argsFactory: (args: TArgs, settings: TSettings) => TArgs | PromiseLike<TArgs>

      The function that produces the argument object for the execution.

        • (args: TArgs, settings: TSettings): TArgs | PromiseLike<TArgs>
        • Parameters

          • args: TArgs
          • settings: TSettings

          Returns TArgs | PromiseLike<TArgs>

    Returns Promise<any>

    The promise with the result of the execution.

filterConditionals

  • filterConditionals<TObj>(objs: TObj | TObj[]): TObj[]

filterForPlatform

  • filterForPlatform<TObj>(objs: TObj | TObj[]): TObj[]
  • Filters "platform" items.

    Type parameters

    Parameters

    • objs: TObj | TObj[]

      The objects to check.

    Returns TObj[]

    The filtered items.

getApps

getCommands

getConfigImports

getEvents

getEventsBy

getExistingFullPath

  • getExistingFullPath(p: string): string | false
  • Returns the full path of an existing file.

    Parameters

    • p: string

      The input path value.

    Returns string | false

    The full path or (false) if not found.

getFolderLookups

  • getFolderLookups(): string[]
  • Returns the list of folders to lookup for relative paths.

    Returns string[]

    Folder lookups.

getInfo

getJobs

getMaxListeners

  • getMaxListeners(): number

getValues

  • getValues(all?: boolean): Value[]
  • Returns the list of all values.

    Parameters

    • Optional all: boolean

    Returns Value[]

    The list of values.

importValues

  • importValues<TObj>(obj: TObj, clone?: boolean): TObj
  • Imports values to an object.

    Type parameters

    Parameters

    • obj: TObj

      The object where to import the values in.

    • Optional clone: boolean

    Returns TObj

    The object that contains the imported values.

initialize

  • initialize(): Promise<boolean>

isInGit

  • isInGit(p: string): boolean
  • Checks if a path is inside the '.git' folder.

    Parameters

    • p: string

      The path to check.

    Returns boolean

    Is in '.git' folder or not.

isInVscode

  • isInVscode(p: string): boolean
  • Checks if a path is inside the '.vscode' folder.

    Parameters

    • p: string

      The path to check.

    Returns boolean

    Is in '.vscode' folder or not.

isPathOf

  • isPathOf(path: string): boolean
  • Checks if a path is part of that workspace.

    Parameters

    • path: string

      The path to check.

    Returns boolean

    Is part of that workspace or not.

listenerCount

  • listenerCount(event: string | symbol): number
  • Parameters

    • event: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: (...args: any[]) => void): Workspace
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Workspace

on

  • on(event: string | symbol, listener: (...args: any[]) => void): Workspace
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Workspace

onDidChangeConfiguration

  • onDidChangeConfiguration(e: ConfigurationChangeEvent): Promise<void>

onDidOpenTextDocument

  • onDidOpenTextDocument(doc: TextDocument): Promise<void>
  • Is invoked when a text document has been opened.

    Parameters

    • doc: TextDocument

      The underlying text document.

    Returns Promise<void>

onDidSaveTextDocument

  • onDidSaveTextDocument(doc: TextDocument): Promise<void>
  • Is invoked when a text document has been saved.

    Parameters

    • doc: TextDocument

      The underlying text document.

    Returns Promise<void>

Protected onDispose

  • onDispose(): void

Private onDocumentOpened

  • onDocumentOpened(doc: TextDocument): Promise<void>

Private onFileChange

  • onFileChange(type: FileChangeType, file: Uri, doc?: TextDocument, ...args: any[]): Promise<void>

onWillSaveTextDocument

  • onWillSaveTextDocument(e: TextDocumentWillSaveEvent): Promise<void>
  • Is invoked when a text document is going to be saved.

    Parameters

    • e: TextDocumentWillSaveEvent

      The event arguments.

    Returns Promise<void>

once

  • once(event: string | symbol, listener: (...args: any[]) => void): Workspace
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Workspace

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): Workspace
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Workspace

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): Workspace
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Workspace

raiseConfigImportsChanged

  • raiseConfigImportsChanged(): Promise<void>
  • Raises the event that config imports have changed.

    Returns Promise<void>

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

Private reloadConfiguration

  • reloadConfiguration(): Promise<void>

removeAllListeners

  • removeAllListeners(event?: string | symbol): Workspace

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): Workspace
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Workspace

replaceValues

  • replaceValues(val: any): string
  • Handles a value as string and replaces placeholders.

    Parameters

    • val: any

      The input value.

    Returns string

    The output value.

Private resolveValuePath

  • resolveValuePath(p: string): string | false

runShellCommand

setMaxListeners

toFullPath

  • toFullPath(p: string): string | false
  • Converts to a full path.

    Parameters

    • p: string

      The path to convert.

    Returns string | false

    The pull path or (false) if 'path' could not be converted.

toRelativePath

  • toRelativePath(p: string): string | false
  • Converts to a relative path.

    Parameters

    • p: string

      The path to convert.

    Returns string | false

    The relative path or (false) if 'p' could not be converted.

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Static on

  • on(emitter: EventEmitter, event: string): AsyncIterableIterator<any>
  • Parameters

    • emitter: EventEmitter
    • event: string

    Returns AsyncIterableIterator<any>

Static once

  • once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>
  • once(emitter: DOMEventTarget, event: string): Promise<any[]>
  • Parameters

    • emitter: NodeEventTarget
    • event: string | symbol

    Returns Promise<any[]>

  • Parameters

    • emitter: DOMEventTarget
    • event: string

    Returns Promise<any[]>

Generated using TypeDoc