Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ScriptCommandController

The controller class for that extension.

Hierarchy

  • EventEmitter
    • ScriptCommandController

Implements

  • Disposable

Index

Constructors

constructor

  • Initializes a new instance of that class.

    Parameters

    • context: vscode.ExtensionContext

      The underlying extension context.

    • outputChannel: vscode.OutputChannel

      The global output channel to use.

    • pkgFile: PackageFile

      The package file of that extension.

    Returns ScriptCommandController

Properties

Protected _COMMANDS

_COMMANDS: ScriptCommandEntry[] = []

List of custom commands.

Protected _CONTEXT

_CONTEXT: vscode.ExtensionContext

Stores the extension context.

Protected _OUTPUT_CHANNEL

_OUTPUT_CHANNEL: vscode.OutputChannel

Stores the global output channel.

Protected _PACKAGE_FILE

_PACKAGE_FILE: PackageFile

Stores the package file of that extension.

Protected _config

_config: Configuration

Stores the current configuration.

Protected _currentTextEditor

_currentTextEditor: vscode.TextEditor

Stores the current active text editor.

Protected _fileSystemWatcher

_fileSystemWatcher: vscode.FileSystemWatcher

The global file system watcher.

Protected _htmlDocs

_htmlDocs: Document[]

Storage for global HTML documents.

Protected _isReloadingConfig

_isReloadingConfig: boolean = false

Stores if extension is reloading its configuration or not.

Protected _scriptEvents

_scriptEvents: Events.EventEmitter

Stores the event emitter for scripts.

Static defaultMaxListeners

defaultMaxListeners: number

Accessors

config

context

  • get context(): vscode.ExtensionContext
  • Gets the underlying extension context.

    Returns vscode.ExtensionContext

htmlDocuments

outputChannel

  • get outputChannel(): vscode.OutputChannel
  • Gets the global output channel.

    Returns vscode.OutputChannel

packageFile

Methods

addListener

  • addListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

dispose

  • dispose(): void

emit

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

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

    Returns boolean

eventNames

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

executeCommand

  • executeCommand(): void
  • Executes a command defined by this extension.

    Returns void

Protected executeScriptCommands

  • executeScriptCommands(commandsToExecute: ScriptCommand[], argsFactory?: sc_contracts.ScriptCommandArgumentFactory): Promise<any>
  • Executes script commands.

    Parameters

    • commandsToExecute: ScriptCommand[]

      The commands to execute.

    • Optional argsFactory: sc_contracts.ScriptCommandArgumentFactory

      The function that returns additional arguments for the execution of a command.

    Returns Promise<any>

    The promise.

executeVSCommand

  • executeVSCommand(): void
  • Executes another command of Visual Studio Code.

    Returns void

getCommands

getGlobals

  • getGlobals(): sc_contracts.GlobalVariables
  • Returns the global variables defined in settings.

    Returns sc_contracts.GlobalVariables

    The globals.

getMaxListeners

  • getMaxListeners(): number
  • Returns number

listenerCount

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

    • type: string | symbol

    Returns number

listeners

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

    • event: string | symbol

    Returns Function[]

log

on

  • on(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

onActivated

  • onActivated(): void
  • Event after the extension has been activated.

    Returns void

onDeactivate

  • onDeactivate(): void

onDidChangeActiveTextEditor

  • onDidChangeActiveTextEditor(editor: vscode.TextEditor): void
  • Is invoked after active text editor has been changed.

    Parameters

    • editor: vscode.TextEditor

      The new editor.

    Returns void

onDidChangeConfiguration

  • onDidChangeConfiguration(): void

onDidChangeTextDocument

  • onDidChangeTextDocument(e: vscode.TextDocumentChangeEvent): void
  • Event after text document has been changed.

    Parameters

    • e: vscode.TextDocumentChangeEvent

    Returns void

onDidCloseTextDocument

  • onDidCloseTextDocument(doc: vscode.TextDocument): void
  • Event after a document has closed.

    Parameters

    • doc: vscode.TextDocument

      The document.

    Returns void

onDidOpenTextDocument

  • onDidOpenTextDocument(doc: vscode.TextDocument): void
  • Event after a document has been opened.

    Parameters

    • doc: vscode.TextDocument

      The document.

    Returns void

onDidSaveTextDocument

  • onDidSaveTextDocument(doc: vscode.TextDocument): void
  • Event after a document has been saved.

    Parameters

    • doc: vscode.TextDocument

      The document.

    Returns void

Protected onFileChange

  • onFileChange(e: vscode.Uri, type: FileChangeType, argsFactory?: sc_contracts.ScriptCommandArgumentFactory): void
  • Is invoked on a file / directory change.

    Parameters

    • e: vscode.Uri

      The URI of the item.

    • type: FileChangeType

      The type of change.

    • Optional argsFactory: sc_contracts.ScriptCommandArgumentFactory

    Returns void

onWillSaveTextDocument

  • onWillSaveTextDocument(e: vscode.TextDocumentWillSaveEvent): void
  • Is invoked when a document is going to be saved.

    Parameters

    • e: vscode.TextDocumentWillSaveEvent

      The event data.

    Returns void

once

  • once(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

openHtml

  • openHtml(html: string, title?: string, id?: any): Promise<any>
  • Opens a HTML document in a new tab.

    Parameters

    • html: string

      The HTML document (source code).

    • Optional title: string
    • Optional id: any

    Returns Promise<any>

    The promise.

prependListener

  • prependListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

quickExecution

  • quickExecution(): any

Protected reloadCommands

  • reloadCommands(): void

reloadConfiguration

  • reloadConfiguration(): void

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

Protected selectAndExecuteCommand

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

Protected setupFileSystemWatcher

  • setupFileSystemWatcher(): void

Protected showNewVersionPopup

  • showNewVersionPopup(): void

Static listenerCount

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

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc