@theia/core
- Version 1.60.2
- Published
- 11.9 MB
- 70 dependencies
- EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 license
Install
npm i @theia/core
yarn add @theia/core
pnpm add @theia/core
Overview
Theia is a cloud & desktop IDE framework implemented in TypeScript.
Index
Variables
- ACCOUNTS_MENU
- ACCOUNTS_SUBMENU
- BackendStopwatch
- BackendStopwatchOptions
- CommandContribution
- CommandService
- commandServicePath
- ConnectionHandler
- ContributionFilterRegistry
- ContributionProvider
- EOL
- Filter
- FilterContribution
- ILogger
- isOSX
- isWindows
- logger
- LoggerFactory
- LoggerName
- MAIN_MENU_BAR
- MANAGE_MENU
- MAX_SAFE_INTEGER
- MEMORY_TEXT
- MenuCommandAdapter
- MenuCommandAdapterRegistry
- MenuCommandExecutor
- MenuContribution
- messageServicePath
- OSBackendProvider
- OSBackendProviderPath
- ProgressClient
- QuickInputService
- quickInputServicePath
- QuickPickService
- quickPickServicePath
- ResourceProvider
- ResourceResolver
- rootLoggerName
- servicesPath
- stopwatchPath
- THEIA_VERSION
- UNTITLED_SCHEME
Functions
- bindContribution()
- bindContributionProvider()
- cancelled()
- checkCancelled()
- cloneAndChange()
- cmd()
- commonPrefixLength()
- compare()
- compareIgnoreCase()
- compareSubstring()
- compareSubstringIgnoreCase()
- createUntitledURI()
- deepClone()
- deepFreeze()
- disposableTimeout()
- endsWith()
- equalsIgnoreCase()
- escapeInvisibleChars()
- escapeRegExpCharacters()
- filterItems()
- findMatches()
- generateUuid()
- hashValue()
- isArray()
- isBoolean()
- isCancelled()
- isDefined()
- isEmpty()
- isEmptyObject()
- isError()
- isErrorLike()
- isFunction()
- isLowerAsciiLetter()
- isNumber()
- isObject()
- isString()
- isStringArray()
- isUndefined()
- isUndefinedOrNull()
- isUpperAsciiLetter()
- isUUID()
- notEmpty()
- nullToUndefined()
- regExpFlags()
- setRootLogger()
- split()
- startsWithIgnoreCase()
- unescapeInvisibleChars()
- unreachable()
- unsetRootLogger()
Classes
CommandRegistry
- addRecentCommand()
- clearCommandHistory()
- commandIds
- commands
- contributionProvider
- doFireDidChange()
- doRegisterCommand()
- executeCommand()
- fireDidChange
- fireWillExecuteCommand()
- getActiveHandler()
- getAllCommands()
- getAllHandlers()
- getCommand()
- getToggledHandler()
- getVisibleHandler()
- isEnabled()
- isToggled()
- isVisible()
- onCommandsChanged
- onCommandsChangedEmitter
- onDidExecuteCommand
- onDidExecuteCommandEmitter
- onStart()
- onWillExecuteCommand
- onWillExecuteCommandEmitter
- recent
- registerCommand()
- registerHandler()
- toUnregisterCommands
- unregisterCommand()
MenuModelRegistry
- allChildrenCompound()
- changeEventOnDispose()
- commands
- contributions
- findGroup()
- findSubMenu()
- fireChangeEvent()
- getMenu()
- getMenuNode()
- getParentPath()
- getPath()
- independentSubmenus
- isEmpty()
- isReady
- linkSubmenu()
- onDidChange
- onDidChangeEmitter
- onStart()
- registerIndependentSubmenu()
- registerMenuAction()
- registerMenuNode()
- registerSubmenu()
- removeSingleRootNode()
- root
- unregisterMenuAction()
- unregisterMenuNode()
RpcProtocol
- CANCELLATION_TOKEN_KEY
- cancellationTokenSources
- channel
- decoder
- disposeCancellationEventListener()
- encoder
- handleCancel()
- handleMessage()
- handleNotify()
- handleReply()
- handleReplyErr()
- handleRequest()
- mode
- nextMessageId
- onNotification
- onNotificationEmitter
- pendingRequestCancellationEventListeners
- pendingRequests
- requestHandler
- sendCancel()
- sendNotification()
- sendRequest()
- toDispose
URI
- allLocations
- authority
- displayName
- fragment
- fromComponents()
- fromFilePath()
- getDistinctParents()
- isEqual()
- isEqualOrParent()
- normalizePath()
- parent
- path
- query
- relative()
- resolve()
- resolveToAbsolute()
- scheme
- toComponents()
- toString()
- withAuthority()
- withFragment()
- withoutAuthority()
- withoutFragment()
- withoutPath()
- withoutQuery()
- withPath()
- withQuery()
- withScheme()
Interfaces
QuickPickOptions
- activeItem
- ariaLabel
- autoFocusOnList
- busy
- buttons
- canAcceptInBackground
- canSelectMany
- contextKey
- customButton
- customHover
- customLabel
- description
- enabled
- filterValue
- hideCheckAll
- hideInput
- ignoreFocusOut
- keepScrollPosition
- matchOnDescription
- matchOnDetail
- matchOnLabel
- onDidAccept
- onDidChangeActive
- onDidChangeSelection
- onDidChangeValue
- onDidCustom
- onDidHide
- onDidTriggerButton
- onDidTriggerItemButton
- placeholder
- runIfSingle
- sortByLabel
- step
- title
- totalSteps
- validationMessage
- value
- valueSelection
Enums
Type Aliases
- Bindable
- CMD
- ConnectionErrorHandlerOptions
- ContributionType
- Deferred
- DisposableGroup
- Filter
- JsonRpcConnectionEventEmitter
- JsonRpcProxy
- JsonRpcServer
- Log
- Loggable
- LoggerFactory
- MaybeArray
- MaybeNull
- MaybePromise
- MaybeUndefined
- MenuCommandArguments
- MenuNode
- MenuPath
- MessageProvider
- Mutable
- QuickPickInput
- QuickPickItemOrSeparator
- QuickPicks
- RecursivePartial
- RemoteMeasurement
- RequestHandler
- ResourceProvider
- RpcProtocolFactory
- RpcProxy
- RpcServer
- WaitUntilData
Namespaces
Variables
variable ACCOUNTS_MENU
const ACCOUNTS_MENU: MenuPath;
variable ACCOUNTS_SUBMENU
const ACCOUNTS_SUBMENU: string[];
variable BackendStopwatch
const BackendStopwatch: Symbol;
variable BackendStopwatchOptions
const BackendStopwatchOptions: Symbol;
variable CommandContribution
const CommandContribution: Symbol;
variable CommandService
const CommandService: Symbol;
variable commandServicePath
const commandServicePath: string;
variable ConnectionHandler
const ConnectionHandler: Symbol;
variable ContributionFilterRegistry
const ContributionFilterRegistry: Symbol;
variable ContributionProvider
const ContributionProvider: Symbol;
variable EOL
const EOL: string;
variable Filter
const Filter: Symbol;
variable FilterContribution
const FilterContribution: Symbol;
variable ILogger
const ILogger: Symbol;
variable isOSX
const isOSX: boolean;
variable isWindows
const isWindows: boolean;
variable logger
let logger: ILogger;
variable LoggerFactory
const LoggerFactory: Symbol;
variable LoggerName
const LoggerName: Symbol;
variable MAIN_MENU_BAR
const MAIN_MENU_BAR: MenuPath;
variable MANAGE_MENU
const MANAGE_MENU: MenuPath;
variable MAX_SAFE_INTEGER
const MAX_SAFE_INTEGER: number;
The maximum safe integer (
2^32-1
) is used as a placeholder for large numbers which are not allowed to be floats. For example as line/column arguments for monaco-ranges.
variable MEMORY_TEXT
const MEMORY_TEXT: string;
variable MenuCommandAdapter
const MenuCommandAdapter: Symbol;
variable MenuCommandAdapterRegistry
const MenuCommandAdapterRegistry: Symbol;
variable MenuCommandExecutor
const MenuCommandExecutor: Symbol;
variable MenuContribution
const MenuContribution: Symbol;
variable messageServicePath
const messageServicePath: string;
variable OSBackendProvider
const OSBackendProvider: Symbol;
variable OSBackendProviderPath
const OSBackendProviderPath: string;
variable ProgressClient
const ProgressClient: Symbol;
variable QuickInputService
const QuickInputService: Symbol;
variable quickInputServicePath
const quickInputServicePath: string;
variable QuickPickService
const QuickPickService: Symbol;
variable quickPickServicePath
const quickPickServicePath: string;
variable ResourceProvider
const ResourceProvider: Symbol;
variable ResourceResolver
const ResourceResolver: Symbol;
variable rootLoggerName
const rootLoggerName: string;
variable servicesPath
const servicesPath: string;
variable stopwatchPath
const stopwatchPath: string;
API path of the stopwatch service that exposes the back-end stopwatch to clients.
variable THEIA_VERSION
const THEIA_VERSION: string;
variable UNTITLED_SCHEME
const UNTITLED_SCHEME: string;
Functions
function bindContribution
bindContribution: ( bindable: Bindable, service: interfaces.ServiceIdentifier<any>, contributions: interfaces.ServiceIdentifier<any>[]) => void;
Helper function to bind a service to a list of contributions easily.
Parameter bindable
a Container or the bind function directly.
Parameter service
an already bound service to refer the contributions to.
Parameter contributions
array of contribution identifiers to bind the service to.
function bindContributionProvider
bindContributionProvider: (bindable: Bindable, id: symbol) => void;
function cancelled
cancelled: () => Error;
function checkCancelled
checkCancelled: (token?: CancellationToken) => void;
function cloneAndChange
cloneAndChange: (obj: any, changer: (orig: any) => any) => any;
function cmd
cmd: (command: string, ...args: string[]) => CMD;
function commonPrefixLength
commonPrefixLength: (a: string, b: string) => number;
Returns
the length of the common prefix of the two strings.
function compare
compare: (a: string, b: string) => number;
function compareIgnoreCase
compareIgnoreCase: (a: string, b: string) => number;
function compareSubstring
compareSubstring: ( a: string, b: string, aStart?: number, aEnd?: number, bStart?: number, bEnd?: number) => number;
function compareSubstringIgnoreCase
compareSubstringIgnoreCase: ( a: string, b: string, aStart?: number, aEnd?: number, bStart?: number, bEnd?: number) => number;
function createUntitledURI
createUntitledURI: (extension?: string, parent?: URI) => URI;
Deprecated
Since 1.27.0. Please use
UntitledResourceResolver.createUntitledURI
instead.
function deepClone
deepClone: <T>(obj: T) => T;
function deepFreeze
deepFreeze: <T>(obj: T) => T;
function disposableTimeout
disposableTimeout: ( handler: TimerHandler, timeout?: number, ...arguments: any[]) => Disposable;
function endsWith
endsWith: (haystack: string, needle: string) => boolean;
Determines if haystack ends with needle.
function equalsIgnoreCase
equalsIgnoreCase: (a: string, b: string) => boolean;
function escapeInvisibleChars
escapeInvisibleChars: (value: string) => string;
function escapeRegExpCharacters
escapeRegExpCharacters: (value: string) => string;
Escapes regular expression characters in a given string
function filterItems
filterItems: ( items: QuickPickItemOrSeparator[], filter: string) => QuickPickItemOrSeparator[];
Filter the list of quick pick items based on the provided filter. Items are filtered based on if: - their
label
satisfies the filter usingfuzzy
. - theirdescription
satisfies the filter usingfuzzy
. - theirdetail
satisfies the filter usingfuzzy
. Filtered items are also updated to display proper highlights based on how they were filtered.Parameter items
the list of quick pick items.
Parameter filter
the filter to search for.
Returns
the list of quick pick items that satisfy the filter.
function findMatches
findMatches: ( word: string, pattern: string) => Array<{ start: number; end: number }> | undefined;
Find match highlights when testing a word against a pattern.
Parameter word
the word to test.
Parameter pattern
the word to match against.
Returns
the list of highlights if present.
function generateUuid
generateUuid: () => string;
function hashValue
hashValue: (value: string) => string;
This function will hash the given value using SHA1. The result will be a uuid.
Parameter value
the string to hash
Returns
a uuid
function isArray
isArray: <T>( value: unknown, every?: (value: unknown) => unknown, thisArg?: unknown) => value is T[];
Parameter value
value to check.
Parameter every
optional predicate ran on every element of the array.
Parameter thisArg
value to substitute
this
with when invoking in the predicate.Returns
whether or not
value
is an array.
function isBoolean
isBoolean: (value: unknown) => value is boolean;
function isCancelled
isCancelled: (err: Error | undefined) => boolean;
function isDefined
isDefined: <T>(arg: T | null | undefined) => arg is T;
Returns
whether the provided parameter is defined.
function isEmpty
isEmpty: (arg: Object) => boolean;
true
if the argument is an empty object. Otherwise,false
.
function isEmptyObject
isEmptyObject: (obj: unknown) => obj is object;
Returns
whether the provided parameter is an empty JavaScript Object or not.
function isError
isError: (value: unknown) => value is Error;
function isErrorLike
isErrorLike: (value: unknown) => value is Error;
function isFunction
isFunction: <T extends (...args: unknown[]) => unknown>( value: unknown) => value is T;
function isLowerAsciiLetter
isLowerAsciiLetter: (code: number) => boolean;
function isNumber
isNumber: (value: unknown) => value is number;
function isObject
isObject: <T extends object>(value: unknown) => value is UnknownObject<T>;
function isString
isString: (value: unknown) => value is string;
function isStringArray
isStringArray: (value: unknown) => value is string[];
function isUndefined
isUndefined: (value: unknown) => value is undefined;
function isUndefinedOrNull
isUndefinedOrNull: (obj: unknown) => obj is null;
Returns
whether the provided parameter is undefined or null.
function isUpperAsciiLetter
isUpperAsciiLetter: (code: number) => boolean;
function isUUID
isUUID: (value: string) => boolean;
function notEmpty
notEmpty: <T>(arg: T | undefined | null) => arg is T;
function nullToUndefined
nullToUndefined: <T>(nullable: MaybeNull<T>) => MaybeUndefined<T>;
Creates a shallow copy with all ownkeys of the original object that are
null
madeundefined
function regExpFlags
regExpFlags: (regexp: RegExp) => string;
function setRootLogger
setRootLogger: (aLogger: ILogger) => void;
function split
split: (s: string, splitter: string) => IterableIterator<string>;
function startsWithIgnoreCase
startsWithIgnoreCase: (str: string, candidate: string) => boolean;
function unescapeInvisibleChars
unescapeInvisibleChars: (value: string) => string;
function unreachable
unreachable: (_never: never, message?: string) => never;
Throws when called and statically makes sure that all variants of a type were consumed.
function unsetRootLogger
unsetRootLogger: () => void;
Counterpart of the
#setRootLogger(ILogger)
. Restores theconsole.xxx
bindings to the original one. Invoking has no side-effect ifsetRootLogger
was not called before. Multiple function invocation has no side-effect either.
Classes
class AbstractChannel
abstract class AbstractChannel implements Channel {}
Reusable abstract Channel implementation that sets up the basic channel event listeners and offers a generic close method.
constructor
constructor();
property onClose
readonly onClose: Event<ChannelCloseEvent>;
property onCloseEmitter
onCloseEmitter: Emitter<ChannelCloseEvent>;
property onError
readonly onError: Event<unknown>;
property onErrorEmitter
onErrorEmitter: Emitter<unknown>;
property onMessage
readonly onMessage: Event<MessageProvider>;
property onMessageEmitter
onMessageEmitter: Emitter<MessageProvider>;
property toDispose
protected toDispose: DisposableCollection;
method close
close: () => void;
method getWriteBuffer
abstract getWriteBuffer: () => WriteBuffer;
class AbstractReferenceCollection
abstract class AbstractReferenceCollection<K, V extends Disposable> implements Disposable {}
Abstract class for a map of reference-counted disposable objects, with the following features:
- values are not inserted explicitly; instead, acquire() is used to create the value for a given key, or return the previously created value for it. How the value is created for a given key is implementation specific.
- any subsquent acquire() with the same key will bump the reference count on that value. acquire() returns not the value directly but a reference object that holds the value. Calling dispose() on the reference decreases the value's effective reference count.
- a contained value will have its dispose() function called when its reference count reaches zero. The key/value pair will be purged from the collection.
- calling dispose() on the value directly, instead of calling it on the reference returned by acquire(), will automatically dispose all outstanding references to that value and the key/value pair will be purged from the collection.
- supports synchronous and asynchronous implementations. acquire() will return a Promise if the value cannot be created immediately
- functions has|keys|values|get are always synchronous and the result excludes asynchronous additions in flight.
- functions values|get return the value directly and not a reference to the value. Use these functions to obtain a value without bumping its reference count.
- clients can register to be notified when values are added and removed; notification for asynchronous additions happen when the creation completes, not when it's requested.
- keys can be any value/object that can be successfully stringified using JSON.stringify(), sans arguments
- calling dispose() on the collection will dispose all outstanding references to all contained values, which results in the disposal of the values themselves.
constructor
constructor();
property onDidCreate
readonly onDidCreate: Event<V>;
property onDidCreateEmitter
protected readonly onDidCreateEmitter: Emitter<V>;
property onWillDispose
readonly onWillDispose: Event<V>;
property onWillDisposeEmitter
protected readonly onWillDisposeEmitter: Emitter<V>;
property references
protected readonly references: Map<string, DisposableCollection>;
property toDispose
protected readonly toDispose: DisposableCollection;
method acquire
abstract acquire: (args: K) => MaybePromise<Reference<V>>;
method clear
clear: () => void;
method createReferences
protected createReferences: (key: string, value: V) => DisposableCollection;
method dispose
dispose: () => void;
method doAcquire
protected doAcquire: (key: string, object: V) => Reference<V>;
method get
get: (args: K) => V | undefined;
method has
has: (args: K) => boolean;
method keys
keys: () => K[];
method toKey
protected toKey: (args: K) => string;
method values
values: () => V[];
class ActionMenuNode
class ActionMenuNode implements MenuNode, CommandMenuNode, Partial<AlternativeHandlerMenuNode> {}
Node representing an action in the menu tree structure. It's based on MenuAction for which it tries to determine the best label, icon and sortString with the given data.
constructor
constructor(action: MenuAction, commands: CommandRegistry);
property action
protected readonly action: MenuAction;
property altNode
readonly altNode: ActionMenuNode;
property command
readonly command: string;
property commands
protected readonly commands: CommandRegistry;
property icon
readonly icon: string;
property id
readonly id: string;
property label
readonly label: string;
property sortString
readonly sortString: string;
property when
readonly when: string;
class AsyncEmitter
class AsyncEmitter<T extends WaitUntilEvent> extends Emitter<T> {}
property deliveryQueue
protected deliveryQueue: Promise<void>;
method deliver
protected deliver: ( listeners: Callback[], event: WaitUntilData<T>, token: CancellationToken, promiseJoin?: (p: Promise<any>, listener: Function) => Promise<any>) => Promise<void>;
method fire
fire: ( event: WaitUntilData<T>, token?: CancellationToken, promiseJoin?: (p: Promise<any>, listener: Function) => Promise<any>) => Promise<void>;
Fire listeners async one after another.
class CancellationError
class CancellationError extends Error {}
constructor
constructor();
class CancellationTokenSource
class CancellationTokenSource {}
constructor
constructor(parent?: CancellationToken);
property token
readonly token: CancellationToken;
method cancel
cancel: () => void;
method dispose
dispose: () => void;
class CommandRegistry
class CommandRegistry implements CommandService {}
The command registry manages commands and handlers.
constructor
constructor(contributionProvider: ContributionProvider<CommandContribution>);
property commandIds
readonly commandIds: string[];
Get all registered commands identifiers.
property commands
readonly commands: Command[];
Get all registered commands.
property contributionProvider
protected readonly contributionProvider: ContributionProvider<CommandContribution>;
property fireDidChange
protected fireDidChange: () => Promise<void>;
property onCommandsChanged
readonly onCommandsChanged: Event<void>;
property onCommandsChangedEmitter
protected readonly onCommandsChangedEmitter: Emitter<void>;
property onDidExecuteCommand
readonly onDidExecuteCommand: Event<CommandEvent>;
property onDidExecuteCommandEmitter
protected readonly onDidExecuteCommandEmitter: Emitter<CommandEvent>;
property onWillExecuteCommand
readonly onWillExecuteCommand: Event<WillExecuteCommandEvent>;
property onWillExecuteCommandEmitter
protected readonly onWillExecuteCommandEmitter: Emitter<WillExecuteCommandEvent>;
property recent
recent: Command[];
Get the list of recently used commands.
property toUnregisterCommands
protected readonly toUnregisterCommands: Map<string, Disposable>;
method addRecentCommand
addRecentCommand: (recent: Command | Command[]) => void;
Adds a command to recently used list. Prioritizes commands that were recently executed to be most recent.
Parameter recent
a recent command, or array of recent commands.
method clearCommandHistory
clearCommandHistory: () => void;
Clear the list of recently used commands.
method doFireDidChange
protected doFireDidChange: () => void;
method doRegisterCommand
protected doRegisterCommand: (command: Command) => Disposable;
method executeCommand
executeCommand: <T>(commandId: string, ...args: any[]) => Promise<T | undefined>;
Execute the active handler for the given command and arguments.
Reject if a command cannot be executed.
method fireWillExecuteCommand
protected fireWillExecuteCommand: ( commandId: string, args?: any[]) => Promise<void>;
method getActiveHandler
getActiveHandler: ( commandId: string, ...args: any[]) => CommandHandler | undefined;
Get an active handler for the given command or
undefined
.
method getAllCommands
getAllCommands: () => IterableIterator< Readonly<Command & { handlers: CommandHandler[] }>>;
method getAllHandlers
getAllHandlers: (commandId: string) => CommandHandler[];
Returns with all handlers for the given command. If the command does not have any handlers, or the command is not registered, returns an empty array.
method getCommand
getCommand: (id: string) => Command | undefined;
Get a command for the given command identifier.
method getToggledHandler
getToggledHandler: ( commandId: string, ...args: any[]) => CommandHandler | undefined;
Get a toggled handler for the given command or
undefined
.
method getVisibleHandler
getVisibleHandler: ( commandId: string, ...args: any[]) => CommandHandler | undefined;
Get a visible handler for the given command or
undefined
.
method isEnabled
isEnabled: (command: string, ...args: any[]) => boolean;
Test whether there is an active handler for the given command.
method isToggled
isToggled: (command: string, ...args: any[]) => boolean;
Test whether there is a toggled handler for the given command.
method isVisible
isVisible: (command: string, ...args: any[]) => boolean;
Test whether there is a visible handler for the given command.
method onStart
onStart: () => void;
method registerCommand
registerCommand: (command: Command, handler?: CommandHandler) => Disposable;
Register the given command and handler if present.
Throw if a command is already registered for the given command identifier.
method registerHandler
registerHandler: (commandId: string, handler: CommandHandler) => Disposable;
Register the given handler for the given command identifier.
If there is already a handler for the given command then the given handler is registered as more specific, and has higher priority during enablement, visibility and toggle state evaluations.
method unregisterCommand
unregisterCommand: { (command: Command): void; (id: string): void };
Unregister command from the registry
Parameter command
Unregister command from the registry
Parameter id
class CompositeMenuNode
class CompositeMenuNode implements MutableCompoundMenuNode {}
Node representing a (sub)menu in the menu tree structure.
constructor
constructor( id: string, label?: string, options?: SubMenuOptions, parent?: MenuNodeMetadata & MenuNodeRenderingData & Partial<CompoundMenuNode> & Partial<CommandMenuNode> & Partial<AlternativeHandlerMenuNode> & CompoundMenuNode);
property children
readonly children: readonly MenuNode[];
property icon
readonly icon: string;
property iconClass
iconClass?: string;
property id
readonly id: string;
property isNavigationGroup
static isNavigationGroup: (node: MenuNode) => node is CompoundMenuNode;
Deprecated
1.28 use CompoundMenuNode.isNavigationGroup instead
property isSubmenu
readonly isSubmenu: boolean;
property label
label?: string;
property order
order?: string;
property parent
readonly parent?: MenuNodeMetadata & MenuNodeRenderingData & Partial<CompoundMenuNode> & Partial<CommandMenuNode> & Partial<AlternativeHandlerMenuNode> & CompoundMenuNode;
property role
readonly role: CompoundMenuNodeRole;
property sortString
readonly sortString: string;
property when
readonly when: string;
method addNode
addNode: (node: MenuNode) => Disposable;
method removeNode
removeNode: (id: string) => boolean;
method updateOptions
updateOptions: (options?: SubMenuOptions) => void;
class CompositeMenuNodeWrapper
class CompositeMenuNodeWrapper implements MutableCompoundMenuNode {}
constructor
constructor( wrapped: Readonly<MutableCompoundMenuNode>, parent: CompoundMenuNode, options?: SubMenuOptions);
property children
readonly children: readonly MenuNode[];
property icon
readonly icon: string;
property iconClass
readonly iconClass: string;
property id
readonly id: string;
property isSubmenu
readonly isSubmenu: boolean;
property label
readonly label: string;
property options
protected readonly options?: SubMenuOptions;
property order
readonly order: string;
property parent
readonly parent: CompoundMenuNode;
property role
readonly role: CompoundMenuNodeRole;
property sortString
readonly sortString: string;
property when
readonly when: string;
property wrapped
protected readonly wrapped: Readonly<MutableCompoundMenuNode>;
method addNode
addNode: (node: MenuNode) => Disposable;
method removeNode
removeNode: (id: string) => boolean;
method updateOptions
updateOptions: (options: SubMenuOptions) => void;
class ConnectionErrorHandler
class ConnectionErrorHandler {}
constructor
constructor(options: ConnectionErrorHandlerOptions);
property options
protected readonly options: ResolvedConnectionErrorHandlerOptions;
property restarts
protected readonly restarts: number[];
method shouldRestart
shouldRestart: () => boolean;
method shouldStop
shouldStop: (error: Error, count?: number) => boolean;
class ContributionFilterRegistryImpl
class ContributionFilterRegistryImpl implements ContributionFilterRegistry {}
Registry of contribution filters.
Implement/bind to the
FilterContribution
interface/symbol to register your contribution filters.
constructor
constructor(contributions?: FilterContribution[]);
property genericFilters
protected genericFilters: Filter<Object>[];
property initialized
protected initialized: boolean;
property typeToFilters
protected typeToFilters: Map< interfaces.ServiceIdentifier<any>, Filter<Object>[]>;
method addFilters
addFilters: (types: '*' | ContributionType[], filters: Filter<Object>[]) => void;
method applyFilters
applyFilters: <T extends Object>( toFilter: T[], type: interfaces.ServiceIdentifier<any>) => T[];
method getFilters
protected getFilters: ( type: interfaces.ServiceIdentifier<any>) => Filter<Object>[];
method getOrCreate
protected getOrCreate: ( type: interfaces.ServiceIdentifier<any>) => Filter<Object>[];
class DefaultBackendStopwatch
class DefaultBackendStopwatch {}
Default implementation of the (remote) back-end stopwatch service.
property idSequence
protected idSequence: number;
property measurements
readonly measurements: Map<number, Measurement>;
property stopwatch
protected readonly stopwatch: Stopwatch;
method start
start: (name: string, options?: MeasurementOptions) => RemoteMeasurement;
method stop
stop: ( measurementToken: RemoteMeasurement, message: string, messageArgs: any[]) => void;
class DefaultResourceProvider
class DefaultResourceProvider {}
constructor
constructor(resolversProvider: ContributionProvider<ResourceResolver>);
property resolversProvider
protected readonly resolversProvider: ContributionProvider<ResourceResolver>;
method get
get: (uri: URI) => Promise<Resource>;
Reject if a resource cannot be provided.
method init
init: () => void;
class DisposableCollection
class DisposableCollection implements Disposable {}
Utility for tracking a collection of Disposable objects.
This utility provides a number of benefits over just using an array of Disposables:
- the collection is auto-pruned when an element it contains is disposed by any code that has a reference to it - you can register to be notified when all elements in the collection have been disposed [1] - you can conveniently dispose all elements by calling dispose() on the collection
Unlike an array, however, this utility does not give you direct access to its elements.
Being notified when all elements are disposed is simple:
const dc = new DisposableCollection(myDisposables);dc.onDispose(() => {console.log('All elements in the collection have been disposed');});[1] The collection will notify only once. It will continue to function in so far as accepting new Disposables and pruning them when they are disposed, but such activity will never result in another notification.
constructor
constructor(...toDispose: Disposable[]);
property disposables
protected readonly disposables: Disposable[];
property disposed
readonly disposed: boolean;
property onDispose
readonly onDispose: Event<void>;
This event is fired only once on first dispose of not empty collection.
property onDisposeEmitter
protected readonly onDisposeEmitter: Emitter<void>;
method checkDisposed
protected checkDisposed: () => void;
method dispose
dispose: () => void;
method push
push: (disposable: Disposable) => Disposable;
method pushAll
pushAll: (disposables: Disposable[]) => Disposable[];
class DisposableWrapper
class DisposableWrapper implements Disposable {}
Wrapper for a Disposable that is not available immediately.
class Emitter
class Emitter<T = any> {}
constructor
constructor(_options?: EmitterOptions);
property event
readonly event: Event<T>;
For the public to allow to subscribe to events from this Emitter
method checkMaxListeners
protected checkMaxListeners: (maxListeners: number) => (() => void) | undefined;
method dispose
dispose: () => void;
method fire
fire: (event: T) => any;
To be kept private to fire an event to subscribers
method popLeakingStack
protected popLeakingStack: (stack: string) => void;
method pushLeakingStack
protected pushLeakingStack: () => () => void;
method sequence
sequence: ( processor: (listener: (e: T) => any) => MaybePromise<boolean>) => Promise<void>;
Process each listener one by one. Return
false
to stop iterating over the listeners,true
to continue.
class InMemoryResources
class InMemoryResources implements ResourceResolver {}
property resources
protected readonly resources: SyncReferenceCollection<string, MutableResource>;
method acquire
protected acquire: (uri: string) => ReferenceMutableResource;
method add
add: (uri: URI, contents: string) => Resource;
method resolve
resolve: (uri: URI) => Resource;
method update
update: (uri: URI, contents: string) => Resource;
class InMemoryTextResource
class InMemoryTextResource implements Resource {}
Resource implementation for 'mem-txt' URI scheme where content is saved in URI query.
constructor
constructor(uri: URI);
property uri
readonly uri: URI;
method dispose
dispose: () => void;
method readContents
readContents: ( options?: { encoding?: string | undefined } | undefined) => Promise<string>;
class InMemoryTextResourceResolver
class InMemoryTextResourceResolver implements ResourceResolver {}
ResourceResolver implementation for 'mem-txt' URI scheme.
method resolve
resolve: (uri: URI) => MaybePromise<Resource>;
class JsonRpcConnectionHandler
class JsonRpcConnectionHandler<T extends object> extends RpcConnectionHandler<T> {}
Deprecated
since 1.39.0 use
RpcConnectionHandler
instead
class JsonRpcProxyFactory
class JsonRpcProxyFactory<T extends object> extends RpcProxyFactory<T> {}
Deprecated
since 1.39.0 use
RpcProxyFactory
instead
class Logger
class Logger implements ILogger {}
property cache
protected cache: Map<string, ILogger>;
property created
protected created: Promise<void>;
property factory
protected readonly factory: LoggerFactory;
property loggerWatcher
protected readonly loggerWatcher: LoggerWatcher;
property name
protected name: string;
property server
protected readonly server: ILoggerServer;
method child
child: (name: string) => ILogger;
method debug
debug: (arg: any | Loggable, ...params: any[]) => Promise<void>;
method error
error: (arg: any | Loggable, ...params: any[]) => Promise<void>;
method fatal
fatal: (arg: any | Loggable, ...params: any[]) => Promise<void>;
method format
protected format: (value: any) => any;
method getLog
protected getLog: (logLevel: number) => Promise<Log>;
method getLogLevel
getLogLevel: () => Promise<number>;
method ifDebug
ifDebug: () => Promise<void>;
method ifEnabled
ifEnabled: (logLevel: number) => Promise<void>;
method ifError
ifError: () => Promise<void>;
method ifFatal
ifFatal: () => Promise<void>;
method ifInfo
ifInfo: () => Promise<void>;
method ifTrace
ifTrace: () => Promise<void>;
method ifWarn
ifWarn: () => Promise<void>;
method info
info: (arg: any | Loggable, ...params: any[]) => Promise<void>;
method init
protected init: () => void;
method isDebug
isDebug: () => Promise<boolean>;
method isEnabled
isEnabled: (logLevel: number) => Promise<boolean>;
method isError
isError: () => Promise<boolean>;
method isFatal
isFatal: () => Promise<boolean>;
method isInfo
isInfo: () => Promise<boolean>;
method isTrace
isTrace: () => Promise<boolean>;
method isWarn
isWarn: () => Promise<boolean>;
method log
log: (logLevel: number, arg2: any | Loggable, ...params: any[]) => Promise<void>;
method setLogLevel
setLogLevel: (logLevel: number) => Promise<void>;
method trace
trace: (arg: any | Loggable, ...params: any[]) => Promise<void>;
method warn
warn: (arg: any | Loggable, ...params: any[]) => Promise<void>;
class MenuCommandAdapterRegistryImpl
class MenuCommandAdapterRegistryImpl implements MenuCommandAdapterRegistry {}
property adapters
protected readonly adapters: MenuCommandAdapter[];
method getAdapterFor
getAdapterFor: ( menuPath: MenuPath, command: string, ...commandArgs: unknown[]) => MenuCommandAdapter | undefined;
method registerAdapter
registerAdapter: (adapter: MenuCommandAdapter) => Disposable;
class MenuCommandExecutorImpl
class MenuCommandExecutorImpl implements MenuCommandExecutor {}
property adapterRegistry
protected readonly adapterRegistry: MenuCommandAdapterRegistry;
property commandRegistry
protected readonly commandRegistry: CommandRegistry;
method delegate
protected delegate: <T extends keyof MenuCommandExecutor>( menuPath: MenuPath, command: string, commandArgs: unknown[], method: T) => ReturnType<MenuCommandExecutor[T]>;
method executeCommand
executeCommand: ( menuPath: MenuPath, command: string, ...commandArgs: unknown[]) => Promise<unknown>;
method isEnabled
isEnabled: ( menuPath: MenuPath, command: string, ...commandArgs: unknown[]) => boolean;
method isToggled
isToggled: ( menuPath: MenuPath, command: string, ...commandArgs: unknown[]) => boolean;
method isVisible
isVisible: ( menuPath: MenuPath, command: string, ...commandArgs: unknown[]) => boolean;
class MenuModelRegistry
class MenuModelRegistry {}
The MenuModelRegistry allows to register and unregister menus, submenus and actions via strings and MenuActions without the need to access the underlying UI representation.
constructor
constructor( contributions: ContributionProvider<MenuContribution>, commands: CommandRegistry);
property commands
protected readonly commands: CommandRegistry;
property contributions
protected readonly contributions: ContributionProvider<MenuContribution>;
property independentSubmenus
protected readonly independentSubmenus: Map<string, MutableCompoundMenuNode>;
property isReady
protected isReady: boolean;
property onDidChange
readonly onDidChange: Event<MenuChangedEvent>;
property onDidChangeEmitter
protected readonly onDidChangeEmitter: Emitter<MenuChangedEvent>;
property root
protected readonly root: CompositeMenuNode;
method allChildrenCompound
protected allChildrenCompound: (children: ReadonlyArray<MenuNode>) => boolean;
method changeEventOnDispose
protected changeEventOnDispose: ( path: MenuPath, id: string, disposable: Disposable) => Disposable;
method findGroup
protected findGroup: ( menuPath: MenuPath, options?: SubMenuOptions) => MutableCompoundMenuNode;
Finds a submenu as a descendant of the
root
node. See .
method findSubMenu
protected findSubMenu: ( current: MutableCompoundMenuNode, menuId: string, options?: SubMenuOptions) => MutableCompoundMenuNode;
Finds or creates a submenu as an immediate child of
current
.Throws
if a node with the given
menuId
exists but is not a MutableCompoundMenuNode.
method fireChangeEvent
protected fireChangeEvent: <T extends MenuChangedEvent>(evt: T) => void;
method getMenu
getMenu: (menuPath?: MenuPath) => MutableCompoundMenuNode;
Returns the menu at the given path.
Parameter menuPath
the path specifying the menu to return. If not given the empty path will be used.
Returns
the root menu when
menuPath
is empty. IfmenuPath
is not empty the specified menu is returned if it exists, otherwise an error is thrown.
method getMenuNode
getMenuNode: ( menuPath: MenuPath | string, group?: string) => MutableCompoundMenuNode;
method getParentPath
protected getParentPath: ( menuPath: MenuPath | string, group?: string) => string[];
method getPath
getPath: (node: MenuNode) => MenuPath | undefined;
Returns the at which a given menu node can be accessed from this registry, if it can be determined. Returns
undefined
if theparent
of any node in the chain is unknown.
method isEmpty
protected isEmpty: (children: ReadonlyArray<MenuNode>) => boolean;
method linkSubmenu
linkSubmenu: ( parentPath: MenuPath | string, childId: string | MenuPath, options?: SubMenuOptions, group?: string) => Disposable;
method onStart
onStart: () => void;
method registerIndependentSubmenu
registerIndependentSubmenu: ( id: string, label: string, options?: SubMenuOptions) => Disposable;
method registerMenuAction
registerMenuAction: (menuPath: MenuPath, item: MenuAction) => Disposable;
Adds the given menu action to the menu denoted by the given path.
Returns
a disposable which, when called, will remove the menu action again.
method registerMenuNode
registerMenuNode: ( menuPath: MenuPath | string, menuNode: MenuNode, group?: string) => Disposable;
Adds the given menu node to the menu denoted by the given path.
Returns
a disposable which, when called, will remove the menu node again.
method registerSubmenu
registerSubmenu: ( menuPath: MenuPath, label: string, options?: SubMenuOptions) => Disposable;
Register a new menu at the given path with the given label. (If the menu already exists without a label, iconClass or order this method can be used to set them.)
Parameter menuPath
the path for which a new submenu shall be registered.
Parameter label
the label to be used for the new submenu.
Parameter options
optionally allows to set an icon class and specify the order of the new menu.
Returns
if the menu was successfully created a disposable will be returned which, when called, will remove the menu again. If the menu already existed a no-op disposable will be returned.
Note that if the menu already existed and was registered with a different label an error will be thrown.
method removeSingleRootNode
removeSingleRootNode: ( fullMenuModel: MutableCompoundMenuNode, menuPath: MenuPath) => CompoundMenuNode;
Checks the given menu model whether it will show a menu with a single submenu.
Parameter fullMenuModel
the menu model to analyze
Parameter menuPath
the menu's path
Returns
if the menu will show a single submenu this returns a menu that will show the child elements of the submenu, otherwise the given
fullMenuModel
is return
method unregisterMenuAction
unregisterMenuAction: { (item: MenuAction, menuPath?: MenuPath): void; (command: Command, menuPath?: MenuPath): void; (id: string, menuPath?: MenuPath): void;};
Unregister all menu nodes with the same id as the given menu action.
Parameter item
the item whose id will be used.
Parameter menuPath
if specified only nodes within the path will be unregistered.
Unregister all menu nodes with the same id as the given command.
Parameter command
the command whose id will be used.
Parameter menuPath
if specified only nodes within the path will be unregistered.
Unregister all menu nodes with the given id.
Parameter id
the id which shall be removed.
Parameter menuPath
if specified only nodes within the path will be unregistered.
method unregisterMenuNode
unregisterMenuNode: (id: string) => void;
Recurse all menus, removing any menus matching the
id
.Parameter id
technical identifier of the
MenuNode
.
class MessageClient
class MessageClient {}
method reportProgress
reportProgress: ( progressId: string, update: ProgressUpdate, message: ProgressMessage, cancellationToken: CancellationToken) => Promise<void>;
Update a previously created progress message.
To be implemented by an extension, e.g. by the messages extension.
method showMessage
showMessage: (message: Message) => Promise<string | undefined>;
Show a message of the given type and possible actions to the user. Resolve to a chosen action. Never reject.
To be implemented by an extension, e.g. by the messages extension.
method showProgress
showProgress: ( progressId: string, message: ProgressMessage, cancellationToken: CancellationToken) => Promise<string | undefined>;
Show a progress message with possible actions to user.
To be implemented by an extension, e.g. by the messages extension.
class MessageService
class MessageService {}
Service to log and categorize messages, show progress information and offer actions.
The messages are processed by this service and forwarded to an injected MessageClient. For example "@theia/messages" provides such a client, rendering messages as notifications in the frontend.
### Example usage
@inject(MessageService)protected readonly messageService: MessageService;messageService.warn("Typings not available");messageService.error("Could not restore state", ["Rollback", "Ignore"]).then(action => action === "Rollback" && rollback());
constructor
constructor(client: MessageClient);
property client
protected readonly client: MessageClient;
method error
error: { <T extends string>(message: string, ...actions: T[]): Promise<T | undefined>; <T extends string>( message: string, options?: MessageOptions, ...actions: T[] ): Promise<T>;};
Logs the message as "error" and, if given, offers actions to act on it.
Parameter message
the message to log.
Parameter actions
the actions to offer. Can be omitted.
Returns
the selected action if there is any,
undefined
when there was no action or none was selected.Logs the message as "error" and, if given, offers actions to act on it.
Parameter message
the message to log.
Parameter options
additional options. Can be omitted
Parameter actions
the actions to offer. Can be omitted.
Returns
the selected action if there is any,
undefined
when there was no action or none was selected.
method info
info: { <T extends string>(message: string, ...actions: T[]): Promise<T | undefined>; <T extends string>( message: string, options?: MessageOptions, ...actions: T[] ): Promise<T>;};
Logs the message as "info" and, if given, offers actions to act on it.
Parameter message
the message to log.
Parameter actions
the actions to offer. Can be omitted.
Returns
the selected action if there is any,
undefined
when there was no action or none was selected.Logs the message as "info" and, if given, offers actions to act on it.
Parameter message
the message to log.
Parameter options
additional options. Can be omitted
Parameter actions
the actions to offer. Can be omitted.
Returns
the selected action if there is any,
undefined
when there was no action or none was selected.
method log
log: { <T extends string>(message: string, ...actions: T[]): Promise<T | undefined>; <T extends string>( message: string, options?: MessageOptions, ...actions: T[] ): Promise<T>;};
Logs the message and, if given, offers actions to act on it.
Parameter message
the message to log.
Parameter actions
the actions to offer. Can be omitted.
Returns
the selected action if there is any,
undefined
when there was no action or none was selected.Logs the message and, if given, offers actions to act on it.
Parameter message
the message to log.
Parameter options
additional options. Can be omitted
Parameter actions
the actions to offer. Can be omitted.
Returns
the selected action if there is any,
undefined
when there was no action or none was selected.
method newProgressId
protected newProgressId: () => string;
method processMessage
protected processMessage: ( type: MessageType, text: string, args?: any[]) => Promise<string | undefined>;
method showProgress
showProgress: ( message: ProgressMessage, onDidCancel?: () => void) => Promise<Progress>;
Shows the given message as a progress.
Parameter message
the message to show for the progress.
Parameter onDidCancel
an optional callback which will be invoked if the progress indicator was canceled.
Returns
a promise resolving to a Progress object with which the progress can be updated.
### Example usage
@inject(MessageService)protected readonly messageService: MessageService;// this will show "Progress" as a cancelable messagethis.messageService.showProgress({text: 'Progress'});// this will show "Rolling back" with "Cancel" and an additional "Skip" actionthis.messageService.showProgress({text: `Rolling back`,actions: ["Skip"],},() => console.log("canceled")).then((progress) => {// register if interested in the result (only necessary for custom actions)progress.result.then((result) => {// will be 'Cancel', 'Skip' or `undefined`console.log("result is", result);});progress.report({message: "Cleaning references", work: {done: 10, total: 100}});progress.report({message: "Restoring previous state", work: {done: 80, total: 100}});progress.report({message: "Complete", work: {done: 100, total: 100}});// we are done so we can cancel the progress message, note that this will also invoke `onDidCancel`progress.cancel();});
method warn
warn: { <T extends string>(message: string, ...actions: T[]): Promise<T | undefined>; <T extends string>( message: string, options?: MessageOptions, ...actions: T[] ): Promise<T>;};
Logs the message as "warning" and, if given, offers actions to act on it.
Parameter message
the message to log.
Parameter actions
the actions to offer. Can be omitted.
Returns
the selected action if there is any,
undefined
when there was no action or none was selected.Logs the message as "warning" and, if given, offers actions to act on it.
Parameter message
the message to log.
Parameter options
additional options. Can be omitted
Parameter actions
the actions to offer. Can be omitted.
Returns
the selected action if there is any,
undefined
when there was no action or none was selected.
class MutableResource
class MutableResource implements Resource {}
constructor
constructor(uri: URI);
property contents
protected contents: string;
property onDidChangeContents
readonly onDidChangeContents: Event<void>;
property onDidChangeContentsEmitter
protected readonly onDidChangeContentsEmitter: Emitter<void>;
property uri
readonly uri: URI;
method dispose
dispose: () => void;
method fireDidChangeContents
protected fireDidChangeContents: () => void;
method readContents
readContents: () => Promise<string>;
method saveContents
saveContents: (contents: string) => Promise<void>;
class NullBackendStopwatch
class NullBackendStopwatch implements BackendStopwatch {}
No-op implementation of the (remote) back-end stopwatch service.
class Path
class Path {}
constructor
constructor(raw: string);
The raw should be normalized, meaning that only '/' is allowed as a path separator.
property base
readonly base: string;
property dir
readonly dir: Path;
Returns the parent directory if it exists (
hasDir === true
) orthis
otherwise.
property ext
readonly ext: string;
property hasDir
readonly hasDir: boolean;
Returns
true
if this has a parent directory,false
otherwise._This implementation returns
true
if and only if this is not the root dir and there is a path separator in the raw path._
property isAbsolute
readonly isAbsolute: boolean;
property isRoot
readonly isRoot: boolean;
property name
readonly name: string;
property root
readonly root: Path;
property separator
static separator: string;
method computeDir
protected computeDir: () => Path;
method computeRoot
protected computeRoot: () => Path | undefined;
method fsPath
fsPath: (format?: Path.Format) => string;
Converts the current path into a file system path.
Parameter format
Determines the format of the path. If
undefined
, the format will be determined by theOS.backend.type
value.Returns
A file system path.
method isDrive
static isDrive: (segment: string) => boolean;
method isEqualOrParent
isEqualOrParent: (path: Path) => boolean;
method join
join: (...paths: string[]) => Path;
method normalize
normalize: () => Path;
method normalizeDrive
static normalizeDrive: (path: string) => string;
vscode-uri always normalizes drive letters to lower case: https://github.com/Microsoft/vscode-uri/blob/b1d3221579f97f28a839b6f996d76fc45e9964d8/src/index.ts#L1025 Theia path should be adjusted to this.
method normalizePathSeparator
static normalizePathSeparator: (path: string) => string;
Normalize path separator to use Path.separator
Parameter Path
candidate to normalize
Returns
Normalized string path
method relative
relative: (path: Path) => Path | undefined;
method relativity
relativity: (path: Path) => number;
method resolve
resolve: (...paths: string[]) => Path | undefined;
Parameter paths
portions of a path
Returns
a new Path if an absolute path can be computed from the segments passed in + this.raw If no absolute path can be computed, returns undefined.
Processes the path segments passed in from right to left (reverse order) concatenating until an absolute path is found.
method tildify
static tildify: (resourcePath: string, home: string) => string;
Tildify path, replacing
home
with~
if user'shome
is present at the beginning of the path. This is a non-operation for Windows.Parameter resourcePath
Parameter home
method toString
toString: () => string;
method untildify
static untildify: (resourcePath: string, home: string) => string;
Untildify path, replacing
~
withhome
if~
present at the beginning of the path. This is a non-operation for Windows.Parameter resourcePath
Parameter home
method windowsPath
static windowsPath: (path: string) => string;
Creates a windows path from the given path string. A windows path uses an upper case drive letter and backwards slashes.
Parameter path
The input path
Returns
Windows style path
class ProgressService
class ProgressService {}
property client
protected readonly client: ProgressClient;
property messageService
protected readonly messageService: MessageService;
method newProgressId
protected newProgressId: () => string;
method shouldDelegate
protected shouldDelegate: (message: ProgressMessage) => boolean;
method showProgress
showProgress: ( message: ProgressMessage, onDidCancel?: () => void) => Promise<Progress>;
method withProgress
withProgress: <T>( text: string, locationId: string, task: () => Promise<T>, onDidCancel?: () => void) => Promise<T>;
class QueueableEmitter
class QueueableEmitter<T> extends Emitter<T[]> {}
property currentQueue
currentQueue?: T[];
method fire
fire: () => void;
method queue
queue: (...arg: T[]) => void;
class ReferenceCollection
class ReferenceCollection< K, V extends Disposable> extends AbstractReferenceCollection<K, V> {}
Asynchronous implementation of AbstractReferenceCollection that requires the client to provide a value factory, used to service the acquire() function. That factory may return a Promise if the value cannot be created immediately.
constructor
constructor(factory: (key: K) => MaybePromise<V>);
property factory
protected readonly factory: (key: K) => MaybePromise<V>;
property pendingValues
protected readonly pendingValues: Map<string, MaybePromise<V>>;
method acquire
acquire: (args: K) => Promise<Reference<V>>;
method getOrCreateValue
protected getOrCreateValue: (key: string, args: K) => Promise<V>;
class ReferenceMutableResource
class ReferenceMutableResource implements Resource {}
constructor
constructor(reference: Reference<MutableResource>);
property onDidChangeContents
readonly onDidChangeContents: Event<void>;
property reference
protected reference: Reference<MutableResource>;
property uri
readonly uri: URI;
method dispose
dispose: () => void;
method readContents
readContents: () => Promise<string>;
method saveContents
saveContents: (contents: string) => Promise<void>;
class RpcConnectionHandler
class RpcConnectionHandler<T extends object> implements ConnectionHandler {}
constructor
constructor( path: string, targetFactory: (proxy: RpcProxy<T>) => any, factoryConstructor?: new () => RpcProxyFactory<T>);
property factoryConstructor
readonly factoryConstructor: new () => RpcProxyFactory<T>;
property path
readonly path: string;
property targetFactory
readonly targetFactory: (proxy: RpcProxy<T>) => any;
method onConnection
onConnection: (connection: Channel) => void;
class RpcProtocol
class RpcProtocol {}
Establish a RPC protocol on top of a given channel. By default the rpc protocol is bi-directional, meaning it is possible to send requests and notifications to the remote side (i.e. acts as client) as well as receiving requests and notifications from the remote side (i.e. acts as a server). Clients can get a promise for a remote request result that will be either resolved or rejected depending on the success of the request. Keeps track of outstanding requests and matches replies to the appropriate request Currently, there is no timeout handling for long running requests implemented. The bi-directional mode can be reconfigured using the RpcProtocolOptions to construct an RPC protocol instance that acts only as client or server instead.
constructor
constructor( channel: Channel, requestHandler: RequestHandler, options?: RpcProtocolOptions);
property CANCELLATION_TOKEN_KEY
static readonly CANCELLATION_TOKEN_KEY: string;
property cancellationTokenSources
protected readonly cancellationTokenSources: Map< number, CancellationTokenSource>;
property channel
readonly channel: Channel;
property decoder
protected readonly decoder: RpcMessageDecoder;
property encoder
protected readonly encoder: RpcMessageEncoder;
property mode
protected readonly mode: 'default' | 'clientOnly' | 'serverOnly';
property nextMessageId
protected nextMessageId: number;
property onNotification
readonly onNotification: Event<{ method: string; args: any[] }>;
property onNotificationEmitter
protected readonly onNotificationEmitter: Emitter<{ method: string; args: any[];}>;
property pendingRequestCancellationEventListeners
protected readonly pendingRequestCancellationEventListeners: Map< number, DisposableWrapper>;
property pendingRequests
protected readonly pendingRequests: Map<number, Deferred<any>>;
property requestHandler
readonly requestHandler: RequestHandler;
property toDispose
protected toDispose: DisposableCollection;
method disposeCancellationEventListener
protected disposeCancellationEventListener: (id: number) => void;
method handleCancel
protected handleCancel: (id: number) => void;
method handleMessage
handleMessage: (message: RpcMessage) => void;
method handleNotify
protected handleNotify: ( method: string, args: any[], id?: number) => Promise<void>;
method handleReply
protected handleReply: (id: number, value: any) => void;
method handleReplyErr
protected handleReplyErr: (id: number, error: any) => void;
method handleRequest
protected handleRequest: ( id: number, method: string, args: any[]) => Promise<void>;
method sendCancel
sendCancel: (requestId: number) => void;
method sendNotification
sendNotification: (method: string, args: any[]) => void;
method sendRequest
sendRequest: <T>(method: string, args: any[]) => Promise<T>;
class RpcProxyFactory
class RpcProxyFactory<T extends object> implements ProxyHandler<T> {}
Factory for RPC proxy objects.
A RPC proxy exposes the programmatic interface of an object through Theia's RPC protocol. This allows remote programs to call methods of this objects by sending RPC requests. This takes place over a bi-directional stream, where both ends can expose an object and both can call methods on each other' exposed object.
For example, assuming we have an object of the following type on one end:
class Foo { bar(baz: number): number { return baz + 1 } }
which we want to expose through a RPC interface. We would do:
let target = new Foo() let factory = new RpcProxyFactory('/foo', target) factory.onConnection(connection)
The party at the other end of the
connection
, in order to remotely call methods on this object would do:let factory = new RpcProxyFactory('/foo') factory.onConnection(connection) let proxy = factory.createProxy(); let result = proxy.bar(42) // result is equal to 43
One the wire, it would look like this:
--> { "type":"1", "id": 1, "method": "bar", "args": [42]} <-- { "type":"3", "id": 1, "res": 43}
Note that in the code of the caller, we didn't pass a target object to RpcProxyFactory, because we don't want/need to expose an object. If we had passed a target object, the other side could've called methods on it.
Parameter
- The type of the object to expose to RPC.
constructor
constructor(target?: any, rpcProtocolFactory?: RpcProtocolFactory);
Build a new RpcProxyFactory.
Parameter target
The object to expose to RPC methods calls. If this is omitted, the proxy won't be able to handle requests, only send them.
property onDidCloseConnectionEmitter
protected readonly onDidCloseConnectionEmitter: Emitter<void>;
property onDidOpenConnectionEmitter
protected readonly onDidOpenConnectionEmitter: Emitter<void>;
property rpcDeferred
protected rpcDeferred: Deferred<RpcProtocol>;
property rpcProtocolFactory
protected rpcProtocolFactory: RpcProtocolFactory;
property target
target?: any;
method createProxy
createProxy: () => RpcProxy<T>;
Create a Proxy exposing the interface of an object of type T. This Proxy can be used to do RPC method calls on the remote target object as if it was local.
If
T
implementsRpcServer
then a client is used as a target object for a remote target object.
method deserializeError
protected deserializeError: (capturedError: Error, e: any) => any;
method get
get: (target: T, p: PropertyKey, receiver: any) => any;
Get a callable object that executes a RPC method call.
Getting a property on the Proxy object returns a callable that, when called, executes a RPC call. The name of the property defines the method to be called. The callable takes a variable number of arguments, which are passed in the RPC method call.
For example, if you have a Proxy object:
let fooProxyFactory = RpcProxyFactory('/foo') let fooProxy = fooProxyFactory.createProxy()
accessing
fooProxy.bar
will return a callable that, when called, executes a RPC method call to methodbar
. Therefore, doingfooProxy.bar()
will call thebar
method on the remote Foo object.Parameter target
unused.
Parameter p
The property accessed on the Proxy object.
Parameter receiver
unused.
Returns
A callable that executes the RPC call.
method isNotification
protected isNotification: (p: PropertyKey) => boolean;
Return whether the given property represents a notification.
A property leads to a notification rather than a method call if its name begins with
notify
oron
.Parameter p
The property being called on the proxy. Whether
p
represents a notification.
method listen
listen: (channel: Channel) => void;
Connect a Channel to the factory by creating an RpcProtocol on top of it.
This protocol will be used to send/receive RPC requests and responses.
method onNotification
protected onNotification: (method: string, ...args: any[]) => void;
Process an incoming RPC notification.
Same as [[onRequest]], but called on incoming notifications rather than methods calls.
method onRequest
protected onRequest: (method: string, ...args: any[]) => Promise<any>;
Process an incoming RPC method call.
onRequest is called when the RPC connection received a method call request. It calls the corresponding method on [[target]].
The return value is a Promise object that is resolved with the return value of the method call, if it is successful. The promise is rejected if the called method does not exist or if it throws.
Returns
A promise of the method call completion.
method serializeError
protected serializeError: (e: any) => any;
method waitForConnection
protected waitForConnection: () => void;
class SelectionService
class SelectionService implements SelectionProvider<Object | undefined> {}
Singleton service that is used to share the current selection globally in a Theia application. On each change of selection, subscribers are notified and receive the updated selection object.
property onSelectionChanged
readonly onSelectionChanged: Event<any>;
property onSelectionChangedEmitter
protected readonly onSelectionChangedEmitter: Emitter<any>;
property selection
selection: Object;
class Stopwatch
abstract class Stopwatch {}
A factory of Measurements for performance logging.
constructor
constructor(defaultLogOptions: LogOptions);
property defaultLogOptions
protected readonly defaultLogOptions: LogOptions;
property logger
protected readonly logger: ILogger;
property onDidAddMeasurementResult
readonly onDidAddMeasurementResult: Event<MeasurementResult>;
property onDidAddMeasurementResultEmitter
protected onDidAddMeasurementResultEmitter: Emitter<MeasurementResult>;
property storedMeasurements
readonly storedMeasurements: readonly MeasurementResult[];
method atLevel
protected atLevel: ( logOptions: LogOptions, levelOverride?: LogLevel, optionalArgs?: any[]) => LogOptions;
method createMeasurement
protected createMeasurement: ( name: string, measure: () => { startTime: number; duration: number }, options?: MeasurementOptions) => Measurement;
method log
protected log: ( measurement: Measurement, activity: string, options: LogOptions) => void;
method logLevel
protected logLevel: (elapsed: number, options?: Partial<LogOptions>) => LogLevel;
method mergeLogOptions
protected mergeLogOptions: (logOptions?: Partial<LogOptions>) => LogOptions;
method start
abstract start: (name: string, options?: MeasurementOptions) => Measurement;
Create a Measurement that will compute its elapsed time when logged.
Parameter name
the
Parameter options
optional configuration of the new measurement
Returns
a self-timing measurement
method startAsync
startAsync: <T>( name: string, description: string, computation: () => MaybePromise<T>, options?: MeasurementOptions) => Promise<T>;
Wrap an asynchronous function in a Measurement that logs itself on completion. If obtaining and awaiting the
computation
runs too long according to the threshold set in theoptions
, then the log message is a warning, otherwise a debug log.Parameter name
the to wrap around the function
Parameter description
a description of what the function does, to be included in the log
Parameter computation
a supplier of the asynchronous function to wrap
Parameter options
optional addition configuration as for measure
Returns
the wrapped
computation
See Also
class SyncReferenceCollection
class SyncReferenceCollection< K, V extends Disposable> extends AbstractReferenceCollection<K, V> {}
Synchronous implementation of AbstractReferenceCollection that requires the client to provide a value factory, used to service the acquire() function.
constructor
constructor(factory: (key: K) => V);
property factory
protected readonly factory: (key: K) => V;
method acquire
acquire: (args: K) => Reference<V>;
method getOrCreateValue
protected getOrCreateValue: (key: string, args: K) => V;
class TelemetryTrustedValue
class TelemetryTrustedValue<T> {}
constructor
constructor(value: {});
property value
readonly value: {};
class UntitledResource
class UntitledResource implements Resource {}
constructor
constructor( resources: Map<string, UntitledResource>, uri: URI, content?: string);
property autosaveable
readonly autosaveable: boolean;
property encoding
readonly encoding: string;
property initiallyDirty
readonly initiallyDirty: boolean;
property onDidChangeContents
readonly onDidChangeContents: Event<void>;
property onDidChangeContentsEmitter
protected readonly onDidChangeContentsEmitter: Emitter<void>;
property uri
uri: URI;
property version
readonly version: ResourceVersion;
method dispose
dispose: () => void;
method fireDidChangeContents
protected fireDidChangeContents: () => void;
method readContents
readContents: ( options?: { encoding?: string | undefined } | undefined) => Promise<string>;
method saveContents
saveContents: ( content: string, options?: { encoding?: string; overwriteEncoding?: boolean }) => Promise<void>;
class UntitledResourceResolver
class UntitledResourceResolver implements ResourceResolver {}
property resources
protected readonly resources: Map<string, UntitledResource>;
method createUntitledResource
createUntitledResource: ( content?: string, extension?: string, uri?: URI) => Promise<UntitledResource>;
method createUntitledURI
createUntitledURI: (extension?: string, parent?: URI) => URI;
method has
has: (uri: URI) => boolean;
method resolve
resolve: (uri: URI) => Promise<UntitledResource>;
class URI
class URI {}
constructor
constructor(uri?: any);
property allLocations
readonly allLocations: URI[];
Return all uri from the current to the top most.
property authority
readonly authority: string;
property displayName
readonly displayName: string;
TODO move implementation to
DefaultUriLabelProviderContribution.getName
Deprecated
use
LabelProvider.getName
instead
property fragment
readonly fragment: string;
property parent
readonly parent: URI;
property path
readonly path: Path;
property query
readonly query: string;
property scheme
readonly scheme: string;
method fromComponents
static fromComponents: { (components: UriComponents): URI; (components: undefined): undefined;};
method fromFilePath
static fromFilePath: (path: string) => URI;
method getDistinctParents
static getDistinctParents: (uris: URI[]) => URI[];
method isEqual
isEqual: (uri: URI, caseSensitive?: boolean) => boolean;
method isEqualOrParent
isEqualOrParent: (uri: URI, caseSensitive?: boolean) => boolean;
method normalizePath
normalizePath: () => URI;
return a new URI replacing the current with its normalized path, resolving '..' and '.' segments
method relative
relative: (uri: URI) => Path | undefined;
method resolve
resolve: (path: string | Path) => URI;
method resolveToAbsolute
resolveToAbsolute: (...pathSegments: Array<string | Path>) => URI | undefined;
Returns
a new, absolute URI if one can be computed from the path segments passed in.
method toComponents
toComponents: () => UriComponents;
method toString
toString: (skipEncoding?: boolean) => string;
method withAuthority
withAuthority: (authority: string) => URI;
return a new URI replacing the current with the given authority
method withFragment
withFragment: (fragment: string) => URI;
return a new URI replacing the current with the given fragment
method withoutAuthority
withoutAuthority: () => URI;
return this URI without a authority
method withoutFragment
withoutFragment: () => URI;
return this URI without a fragment
method withoutPath
withoutPath: () => URI;
return this URI without a path
method withoutQuery
withoutQuery: () => URI;
return this URI without a query
method withPath
withPath: (path: string | Path) => URI;
return a new URI replacing the current with the given path
method withQuery
withQuery: (query: string) => URI;
return a new URI replacing the current with the given query
method withScheme
withScheme: (scheme: string) => URI;
return a new URI replacing the current with the given scheme
Interfaces
interface AlternativeHandlerMenuNode
interface AlternativeHandlerMenuNode extends CommandMenuNode {}
property altNode
altNode: CommandMenuNode;
interface ApplicationError
interface ApplicationError<C extends number, D> extends Error {}
interface BackendStopwatch
interface BackendStopwatch {}
A service that exposes the back-end's Stopwatch to clients via the remote API. If you do not need this service then bind or re-bind the NullBackendStopwatch implementation to this service interface.
method start
start: ( name: string, options?: MeasurementOptions) => Promise<RemoteMeasurement>;
Create a Measurement that will compute the time that elapsed on the back-end when logged.
Parameter name
the
Parameter options
optional configuration of the new measurement
Returns
a token identifying an unique self-timing measurement relative to the back-end's timeline
method stop
stop: ( measurement: RemoteMeasurement, message: string, messageArgs: any[]) => Promise<void>;
Stop a measurement previously and log in the back-end a measurement of its duration relative to the back-end's timeline.
Parameter measurement
token identifying a measurement previously
Parameter message
a message to log
Parameter messageArgs
optional arguments to the
message
interface CancellationToken
interface CancellationToken {}
property isCancellationRequested
readonly isCancellationRequested: boolean;
property onCancellationRequested
readonly onCancellationRequested: Event<void>;
interface Channel
interface Channel {}
A channel is a bidirectional communications channel with lifecycle and error signalling. Note that creation of channels is specific to particular implementations and thus not part of the protocol.
property onClose
onClose: Event<ChannelCloseEvent>;
The remote side has closed the channel
property onError
onError: Event<unknown>;
An error has occurred while writing to or reading from the channel
property onMessage
onMessage: Event<MessageProvider>;
A message has arrived and can be read by listeners using a MessageProvider.
method close
close: () => void;
Close this channel. No onClose event should be sent
method getWriteBuffer
getWriteBuffer: () => WriteBuffer;
Obtain a WriteBuffer to write a message to the channel.
interface ChannelCloseEvent
interface ChannelCloseEvent {}
The event that is emitted when a channel is closed from the remote side.
interface Command
interface Command {}
A command is a unique identifier of a function which can be executed by a user via a keyboard shortcut, a menu action or directly.
property category
category?: string;
A category of this command.
property iconClass
iconClass?: string;
An icon class of this command.
property id
id: string;
A unique identifier of this command.
property label
label?: string;
A label of this command.
property originalCategory
originalCategory?: string;
property originalLabel
originalLabel?: string;
property shortTitle
shortTitle?: string;
A short title used for display in menus.
interface CommandContribution
interface CommandContribution {}
The command contribution should be implemented to register custom commands and handler.
method registerCommands
registerCommands: (commands: CommandRegistry) => void;
Register commands and handlers.
interface CommandEvent
interface CommandEvent {}
interface CommandHandler
interface CommandHandler {}
A command handler is an implementation of a command.
A command can have multiple handlers but they should be active in different contexts, otherwise first active will be executed.
property onDidChangeEnabled
onDidChangeEnabled?: Event<void>;
method execute
execute: (...args: any[]) => any;
Execute this handler.
Don't call it directly, use
CommandService.executeCommand
instead.
method isEnabled
isEnabled: (...args: any[]) => boolean;
Test whether this handler is enabled (active).
method isToggled
isToggled: (...args: any[]) => boolean;
Test whether menu items for this handler should be toggled.
method isVisible
isVisible: (...args: any[]) => boolean;
Test whether menu items for this handler should be visible.
interface CommandMenuNode
interface CommandMenuNode extends MenuNodeBase {}
property command
command: string;
interface CommandService
interface CommandService {}
The command service should be used to execute commands.
property onDidExecuteCommand
readonly onDidExecuteCommand: Event<CommandEvent>;
An event is emitted when a command was executed.
property onWillExecuteCommand
readonly onWillExecuteCommand: Event<WillExecuteCommandEvent>;
An event is emitted when a command is about to be executed.
It can be used to install or activate a command handler.
method executeCommand
executeCommand: <T>(command: string, ...args: any[]) => Promise<T | undefined>;
Execute the active handler for the given command and arguments.
Reject if a command cannot be executed.
interface CompoundMenuNode
interface CompoundMenuNode extends MenuNodeBase {}
property children
readonly children: ReadonlyArray<MenuNode>;
Items that are grouped under this menu.
property isSubmenu
readonly isSubmenu: boolean;
Deprecated
1.28 use
role
instead. Whether the item should be rendered as a submenu.
property role
readonly role: CompoundMenuNodeRole;
How the node and its children should be rendered. See CompoundMenuNodeRole.
interface ConnectionHandler
interface ConnectionHandler {}
property path
readonly path: string;
method onConnection
onConnection: (connection: Channel) => void;
interface ContributionFilterRegistry
interface ContributionFilterRegistry {}
method addFilters
addFilters: { (types: '*', filters: Filter<Object>[]): void; ( types: interfaces.ServiceIdentifier<any>[], filters: Filter<Object>[] ): void;};
Add filters to be applied for every type of contribution.
Given a list of contribution types, register filters to apply.
Parameter types
types for which to register the filters.
method applyFilters
applyFilters: <T extends Object>( toFilter: T[], type: interfaces.ServiceIdentifier<any>) => T[];
Applies the filters for the given contribution type. Generic filters will be applied on any given type.
Parameter toFilter
the elements to filter
Parameter type
the contribution type for which potentially filters were registered
Returns
the filtered elements
interface ContributionProvider
interface ContributionProvider<T extends object> {}
method getContributions
getContributions: (recursive?: boolean) => T[];
Parameter recursive
true
if the contributions should be collected from the parent containers as well. Otherwise,false
. It isfalse
by default.
interface Disposable
interface Disposable {}
method dispose
dispose: () => void;
Dispose this object.
interface EmitterOptions
interface EmitterOptions {}
property onFirstListenerAdd
onFirstListenerAdd?: Function;
property onLastListenerRemove
onLastListenerRemove?: Function;
interface Event
interface Event<T> {}
Represents a typed event.
call signature
( listener: (e: T) => any, thisArgs?: any, disposables?: DisposableGroup): Disposable;
Parameter listener
The listener function will be call when the event happens.
Parameter thisArgs
The 'this' which will be used when calling the event listener.
Parameter disposables
An array to which a {{IDisposable}} will be added. a disposable to remove the listener again.
interface FilterContribution
interface FilterContribution {}
Register filters to remove contributions.
method registerContributionFilters
registerContributionFilters: (registry: ContributionFilterRegistry) => void;
Use the registry to register your contribution filters. * Note that filtering contributions based on their class (constructor) name is discouraged. Class names are minified in production builds and therefore not reliable. Use instance of checks or direct constructor comparison instead:
registry.addFilters('*', [contrib => !(contrib instanceof SampleFilteredCommandContribution)]);
interface ILogger
interface ILogger {}
method child
child: (name: string) => ILogger;
Create a child logger from this logger.
Parameter name
The name of the child logger.
method debug
debug: { (loggable: Loggable): Promise<void>; (message: any, ...params: any[]): Promise<void>;};
Log a loggable with the debug level if it is enabled.
Log a message with the debug level if it is enabled.
Parameter message
The message format string.
Parameter params
The format string variables.
method error
error: { (loggable: Loggable): Promise<void>; (message: any, ...params: any[]): Promise<void>;};
Log a loggable with the error level if it is enabled.
Log a message with the error level.
Parameter message
The message format string.
Parameter params
The format string variables.
method fatal
fatal: { (loggable: Loggable): Promise<void>; (message: any, ...params: any[]): Promise<void>;};
Log a loggable with the fatal level if it is enabled.
Log a message with the fatal level if it is enabled.
Parameter message
The message format string.
Parameter params
The format string variables.
method getLogLevel
getLogLevel: () => Promise<number>;
Get the log level.
Returns
a Promise to the log level.
method ifDebug
ifDebug: () => Promise<void>;
Resolve if the debug level is enabled.
method ifEnabled
ifEnabled: (logLevel: number) => Promise<void>;
Resolve if the given log is enabled.
method ifError
ifError: () => Promise<void>;
Resolve if the error level is enabled.
method ifFatal
ifFatal: () => Promise<void>;
Resolve if the fatal level is enabled.
method ifInfo
ifInfo: () => Promise<void>;
Resolve if the info level is enabled.
method ifTrace
ifTrace: () => Promise<void>;
Resolve if the trace level is enabled.
method ifWarn
ifWarn: () => Promise<void>;
Resolve if the warn level is enabled.
method info
info: { (loggable: Loggable): Promise<void>; (message: any, ...params: any[]): Promise<void>;};
Log a loggable with the info level if it is enabled.
Log a message with the info level if it is enabled.
Parameter message
The message format string.
Parameter params
The format string variables.
method isDebug
isDebug: () => Promise<boolean>;
Test whether the debug level is enabled.
method isEnabled
isEnabled: (logLevel: number) => Promise<boolean>;
Test whether the given log level is enabled.
method isError
isError: () => Promise<boolean>;
Test whether the error level is enabled.
method isFatal
isFatal: () => Promise<boolean>;
Test whether the fatal level is enabled.
method isInfo
isInfo: () => Promise<boolean>;
Test whether the info level is enabled.
method isTrace
isTrace: () => Promise<boolean>;
Test whether the trace level is enabled.
method isWarn
isWarn: () => Promise<boolean>;
Test whether the warn level is enabled.
method log
log: { (logLevel: number, loggable: Loggable): Promise<void>; (logLevel: number, message: any, ...params: any[]): void;};
Log a loggable with the given level if it is enabled.
Log a message with the given level if it is enabled.
Parameter logLevel
The loglevel to use.
Parameter message
The message format string.
Parameter params
The format string variables.
method setLogLevel
setLogLevel: (logLevel: number) => Promise<void>;
Set the log level.
Parameter loglevel
The loglevel to set. see Logger.LogLevel for possible options.
method trace
trace: { (loggable: Loggable): Promise<void>; (message: any, ...params: any[]): Promise<void>;};
Log a loggable with the trace level if it is enabled.
Log a message with the trace level if it is enabled.
Parameter message
The message format string.
Parameter params
The format string variables.
method warn
warn: { (loggable: Loggable): Promise<void>; (message: any, ...params: any[]): Promise<void>;};
Log a loggable with the warn level if it is enabled.
Log a message with the warn level if it is enabled.
Parameter message
The message format string.
Parameter params
The format string variables.
interface InputBox
interface InputBox extends QuickInput {}
property buttons
buttons: ReadonlyArray<QuickInputButton>;
property onDidAccept
readonly onDidAccept: Event<void>;
property onDidChangeValue
readonly onDidChangeValue: Event<string>;
property onDidTriggerButton
readonly onDidTriggerButton: Event<QuickInputButton>;
property password
password: boolean;
property placeholder
placeholder: string | undefined;
property prompt
prompt: string | undefined;
property validationMessage
validationMessage: string | undefined;
property value
value: string | undefined;
property valueSelection
valueSelection: Readonly<[number, number]> | undefined;
interface InputOptions
interface InputOptions {}
property ignoreFocusLost
ignoreFocusLost?: boolean;
property password
password?: boolean;
property placeHolder
placeHolder?: string;
property prompt
prompt?: string;
property title
title?: string;
property value
value?: string;
property valueSelection
valueSelection?: [number, number];
method validateInput
validateInput: ( input: string) => | Promise<string | { content: string; severity: number } | null | undefined> | undefined;
interface Measurement
interface Measurement {}
A
Measurement
counts the time elapsed between its creation when the Stopwatch is and when it is .
property elapsed
elapsed?: number;
The elapsed time measured, if it has been and measured, or
NaN
if the platform disabled performance measurement.
property name
name: string;
The measurement name. This may show up in the performance measurement framework appropriate to the application context.
method debug
debug: (detail: string, ...optionalArgs: any[]) => void;
Compute the elapsed time and log a debug message annotated with that timing information.
Parameter detail
a message detailing what activity was measured
Parameter optionalArgs
optional message arguments as per the usual console API
method error
error: (detail: string, ...optionalArgs: any[]) => void;
Compute the elapsed time and log an error message annotated with that timing information.
Parameter detail
a message detailing what activity was measured
Parameter optionalArgs
optional message arguments as per the usual console API
method info
info: (detail: string, ...optionalArgs: any[]) => void;
Compute the elapsed time and log an info message annotated with that timing information.
Parameter detail
a message detailing what activity was measured
Parameter optionalArgs
optional message arguments as per the usual console API
method log
log: (detail: string, ...optionalArgs: any[]) => void;
Compute the elapsed time and log a message annotated with that timing information. The message is logged at the level determined by the MeasurementOptions.
Parameter detail
a message detailing what activity was measured
Parameter optionalArgs
optional message arguments as per the usual console API
method stop
stop: () => number;
Compute the elapsed time, in milliseconds, if not already done (only has effect on the first invocation). A
NaN
result indicates that the watch was stopped but failed to make a measurement.
method warn
warn: (detail: string, ...optionalArgs: any[]) => void;
Compute the elapsed time and log a warning message annotated with that timing information.
Parameter detail
a message detailing what activity was measured
Parameter optionalArgs
optional message arguments as per the usual console API
interface MeasurementOptions
interface MeasurementOptions {}
Optional configuration of a Measurement specified at the time of its creation.
property context
context?: string;
A specific context of the application in which an activity was measured. Results in logs being emitted with a "[]" qualified at the head.
property defaultLogLevel
defaultLogLevel?: LogLevel;
An optional logging level at which to emit the log message. The default value is LogLevel.INFO.
property storeResults
storeResults?: boolean;
Flag to indicate whether the stopwatch should store measurement results for later retrieval. For example the cache can be used to retrieve measurements which were taken during startup before a listener had a chance to register.
property thresholdMillis
thresholdMillis?: number;
Some measurements are measured against a threshold (in millis) that they should not exceed. If omitted, the implied threshold is unlimited time (no threshold).
See Also
interface MeasurementResult
interface MeasurementResult {}
Captures the result of a Measurement in a serializable format.
property elapsed
elapsed: number;
The elapsed time measured, if it has been and measured, or
NaN
if the platform disabled performance measurement.
property name
name: string;
The measurement name. This may show up in the performance measurement framework appropriate to the application context.
property owner
owner?: string;
An optional label for the application the start of which (in real time) is the basis of all measurements.
property startTime
startTime: number;
The time when the measurement recording has been started
interface MenuAction
interface MenuAction extends MenuNodeRenderingData, Pick<MenuNodeMetadata, 'when'> {}
A menu entry representing an action, e.g. "New File".
property alt
alt?: string;
In addition to the mandatory command property, an alternative command can be defined. It will be shown and invoked when pressing Alt while opening a menu.
property commandId
commandId: string;
The command to execute.
property order
order?: string;
Menu entries are sorted in ascending order based on their
order
strings. If omitted the determined label will be used instead.
interface MenuChangedEvent
interface MenuChangedEvent {}
interface MenuCommandAdapter
interface MenuCommandAdapter extends MenuCommandExecutor {}
method canHandle
canHandle: ( menuPath: MenuPath, command: string, ...commandArgs: unknown[]) => number;
Return values less than or equal to 0 are treated as rejections.
interface MenuCommandAdapterRegistry
interface MenuCommandAdapterRegistry {}
method getAdapterFor
getAdapterFor: ( menuPath: MenuPath, command: string, ...commandArgs: unknown[]) => MenuCommandAdapter | undefined;
method registerAdapter
registerAdapter: (adapter: MenuCommandAdapter) => Disposable;
interface MenuCommandExecutor
interface MenuCommandExecutor {}
method executeCommand
executeCommand: ( menuPath: MenuPath, command: string, ...commandArgs: unknown[]) => Promise<unknown>;
method isEnabled
isEnabled: ( menuPath: MenuPath, command: string, ...commandArgs: unknown[]) => boolean;
method isToggled
isToggled: ( menuPath: MenuPath, command: string, ...commandArgs: unknown[]) => boolean;
method isVisible
isVisible: ( menuPath: MenuPath, command: string, ...commandArgs: unknown[]) => boolean;
interface MenuContribution
interface MenuContribution {}
Representation of a menu contribution.
Note that there are also convenience classes which combine multiple contributions into one. For example to register a view together with a menu and keybinding you could use AbstractViewContribution instead.
### Example usage
import { MenuContribution, MenuModelRegistry, MAIN_MENU_BAR } from '@theia/core';@injectable()export class NewMenuContribution implements MenuContribution {registerMenus(menus: MenuModelRegistry): void {const menuPath = [...MAIN_MENU_BAR, '99_mymenu'];menus.registerSubmenu(menuPath, 'My Menu');menus.registerMenuAction(menuPath, {commandId: MyCommand.id,label: 'My Action'});}}
method registerMenus
registerMenus: (menus: MenuModelRegistry) => void;
Registers menus.
Parameter menus
the menu model registry.
interface Message
interface Message {}
property actions
readonly actions?: string[];
Actions offered to the user in the context of the message.
property options
readonly options?: MessageOptions;
Additional options.
property source
readonly source?: string;
property text
readonly text: string;
Message text.
property type
readonly type?: MessageType;
Type of the message, i.e. error, warning, info, etc.
interface MessageOptions
interface MessageOptions {}
property timeout
readonly timeout?: number;
Timeout in milliseconds.
0
and negative values are treated as no timeout.
interface MutableCompoundMenuNode
interface MutableCompoundMenuNode extends CompoundMenuNode {}
method addNode
addNode: (node: MenuNode) => Disposable;
Inserts the given node at the position indicated by
sortString
.Returns
a disposable which, when called, will remove the given node again.
method removeNode
removeNode: (id: string) => boolean;
Removes the first node with the given id.
Parameter id
node id.
Returns
true if the id was present
method updateOptions
updateOptions: (options: SubMenuOptions) => void;
Fills any
undefined
fields with the values from the options.
interface OSBackendProvider
interface OSBackendProvider {}
method getBackendOS
getBackendOS: () => Promise<OS.Type>;
interface PickOptions
interface PickOptions<T extends QuickPickItem> {}
property activeItem
activeItem?: Promise<T> | T;
property autoFocusOnList
autoFocusOnList?: boolean;
property canPickMany
canPickMany?: boolean;
property contextKey
contextKey?: string;
property ignoreFocusLost
ignoreFocusLost?: boolean;
property matchOnDescription
matchOnDescription?: boolean;
property matchOnDetail
matchOnDetail?: boolean;
property matchOnLabel
matchOnLabel?: boolean;
property onDidFocus
onDidFocus?: (entry: T) => void;
property placeHolder
placeHolder?: string;
property title
title?: string;
interface Prioritizeable
interface Prioritizeable<T> {}
interface Progress
interface Progress {}
property cancel
readonly cancel: () => void;
Cancel or complete the current progress.
property id
readonly id: string;
Unique progress id.
property report
readonly report: (update: ProgressUpdate) => void;
Update the current progress.
Parameter update
the data to update.
property result
readonly result: Promise<string | undefined>;
Result of the progress.
Returns
a promise which resolves to either 'Cancel', an alternative action or
undefined
.
interface ProgressClient
interface ProgressClient {}
method reportProgress
reportProgress: ( progressId: string, update: ProgressUpdate, message: ProgressMessage, cancellationToken: CancellationToken) => Promise<void>;
Update a previously created progress message.
method showProgress
showProgress: ( progressId: string, message: ProgressMessage, cancellationToken: CancellationToken) => Promise<string | undefined>;
Show a progress message with possible actions to user.
interface ProgressMessage
interface ProgressMessage extends Message {}
interface ProgressMessageOptions
interface ProgressMessageOptions extends MessageOptions {}
property cancelable
readonly cancelable?: boolean;
Default:
false
property location
readonly location?: string;
Known values:
notification
|window
|scm
interface ProgressUpdate
interface ProgressUpdate {}
interface QuickInput
interface QuickInput {}
property busy
busy: boolean;
property contextKey
contextKey: string | undefined;
property description
description: string | undefined;
property enabled
enabled: boolean;
property ignoreFocusOut
ignoreFocusOut: boolean;
property onDidHide
readonly onDidHide: Event<{ reason: QuickInputHideReason;}>;
property onDispose
readonly onDispose: Event<void>;
property step
step: number | undefined;
property title
title: string | undefined;
property totalSteps
totalSteps: number | undefined;
method dispose
dispose: () => void;
method hide
hide: () => void;
method show
show: () => void;
interface QuickInputButton
interface QuickInputButton {}
property alwaysVisible
alwaysVisible?: boolean;
Whether the button should be visible even when the user is not hovering.
property iconClass
iconClass?: string;
property tooltip
tooltip?: string;
interface QuickInputButtonHandle
interface QuickInputButtonHandle extends QuickInputButton {}
property handle
handle: number;
interface QuickInputService
interface QuickInputService {}
property backButton
readonly backButton: QuickInputButton;
property onHide
readonly onHide: Event<void>;
property onShow
readonly onShow: Event<void>;
method createInputBox
createInputBox: () => InputBox;
method createQuickPick
createQuickPick: <T extends QuickPickItem>() => QuickPick<T>;
Provides raw access to the quick pick controller.
method hide
hide: () => void;
method input
input: ( options?: InputOptions, token?: CancellationToken) => Promise<string | undefined>;
method open
open: (filter: string) => void;
method pick
pick: { <T extends QuickPickItem>( picks: Promise<QuickPickInput<T>[]> | QuickPickInput<T>[], options?: PickOptions<T> & { canPickMany: true }, token?: CancellationToken ): Promise<T[] | undefined>; <T extends QuickPickItem>( picks: QuickPickInput<T>[] | Promise<QuickPickInput<T>[]>, options?: PickOptions<T> & { canPickMany: false }, token?: CancellationToken ): Promise<T>; <T extends QuickPickItem>( picks: QuickPickInput<T>[] | Promise<QuickPickInput<T>[]>, options?: Omit<PickOptions<T>, 'canPickMany'>, token?: CancellationToken ): Promise<T>;};
method showQuickPick
showQuickPick: <T extends QuickPickItem>( items: Array<T | QuickPickSeparator>, options?: QuickPickOptions<T>) => Promise<T | undefined>;
interface QuickPick
interface QuickPick<T extends QuickPickItemOrSeparator> extends QuickInput {}
property activeItems
activeItems: ReadonlyArray<T>;
property buttons
buttons: ReadonlyArray<QuickInputButton>;
property canSelectMany
canSelectMany: boolean;
property items
items: ReadonlyArray<T | QuickPickSeparator>;
property keepScrollPosition
keepScrollPosition: boolean;
property matchOnDescription
matchOnDescription: boolean;
property matchOnDetail
matchOnDetail: boolean;
property onDidAccept
readonly onDidAccept: Event< | { inBackground: boolean; } | undefined>;
property onDidChangeActive
readonly onDidChangeActive: Event<T[]>;
property onDidChangeSelection
readonly onDidChangeSelection: Event<T[]>;
property onDidChangeValue
readonly onDidChangeValue: Event<string>;
property onDidTriggerButton
readonly onDidTriggerButton: Event<QuickInputButton>;
property onDidTriggerItemButton
readonly onDidTriggerItemButton: Event<QuickPickItemButtonEvent<QuickPickItem>>;
property placeholder
placeholder: string | undefined;
property selectedItems
selectedItems: ReadonlyArray<T>;
property value
value: string;
interface QuickPickItem
interface QuickPickItem {}
property alwaysShow
alwaysShow?: boolean;
property ariaLabel
ariaLabel?: string;
property buttons
buttons?: QuickInputButton[];
property description
description?: string;
property detail
detail?: string;
property execute
execute?: () => void;
property highlights
highlights?: QuickPickItemHighlights;
property iconClasses
iconClasses?: string[];
property id
id?: string;
property keySequence
keySequence?: KeySequence;
property label
label: string;
property meta
meta?: string;
property type
type?: 'item';
interface QuickPickItemButtonContext
interface QuickPickItemButtonContext<T extends QuickPickItemOrSeparator> extends QuickPickItemButtonEvent<T> {}
method removeItem
removeItem: () => void;
interface QuickPickItemButtonEvent
interface QuickPickItemButtonEvent<T extends QuickPickItemOrSeparator> {}
interface QuickPickItemHighlights
interface QuickPickItemHighlights {}
property description
description?: Match[];
property detail
detail?: Match[];
property label
label?: Match[];
interface QuickPickOptions
interface QuickPickOptions<T extends QuickPickItemOrSeparator> {}
property activeItem
activeItem?: T;
property ariaLabel
ariaLabel?: string;
property autoFocusOnList
autoFocusOnList?: boolean;
property busy
busy?: boolean;
property buttons
buttons?: Array<QuickInputButton>;
property canAcceptInBackground
canAcceptInBackground?: boolean;
property canSelectMany
canSelectMany?: boolean;
property contextKey
contextKey?: string;
property customButton
customButton?: boolean;
property customHover
customHover?: string;
property customLabel
customLabel?: string;
property description
description?: string;
property enabled
enabled?: boolean;
property filterValue
filterValue?: (value: string) => string;
property hideCheckAll
hideCheckAll?: boolean;
property hideInput
hideInput?: boolean;
property ignoreFocusOut
ignoreFocusOut?: boolean;
property keepScrollPosition
keepScrollPosition?: boolean;
property matchOnDescription
matchOnDescription?: boolean;
property matchOnDetail
matchOnDetail?: boolean;
property matchOnLabel
matchOnLabel?: boolean;
property onDidAccept
onDidAccept?: () => void;
property onDidChangeActive
onDidChangeActive?: (quickPick: QuickPick<T>, activeItems: Array<T>) => void;
property onDidChangeSelection
onDidChangeSelection?: ( quickPick: QuickPick<T>, selectedItems: Array<T>) => void;
property onDidChangeValue
onDidChangeValue?: (quickPick: QuickPick<T>, filter: string) => void;
property onDidCustom
onDidCustom?: () => void;
property onDidHide
onDidHide?: () => void;
property onDidTriggerButton
onDidTriggerButton?: (button: QuickInputButton) => void;
property onDidTriggerItemButton
onDidTriggerItemButton?: ( ItemButtonEvent: QuickPickItemButtonContext<T>) => void;
property placeholder
placeholder?: string;
property runIfSingle
runIfSingle?: boolean;
property sortByLabel
sortByLabel?: boolean;
property step
step?: number;
property title
title?: string;
property totalSteps
totalSteps?: number;
property validationMessage
validationMessage?: string;
property value
value?: string;
property valueSelection
valueSelection?: Readonly<[number, number]>;
interface QuickPickSeparator
interface QuickPickSeparator {}
interface QuickPickSeparator
interface QuickPickSeparator {}
interface QuickPickService
interface QuickPickService {}
property onDidAccept
readonly onDidAccept: Event<void>;
property onDidChangeActive
readonly onDidChangeActive: Event<{ quickPick: QuickPick<QuickPickItem>; activeItems: Array<QuickPickItem>;}>;
property onDidChangeSelection
readonly onDidChangeSelection: Event<{ quickPick: QuickPick<QuickPickItem>; selectedItems: Array<QuickPickItem>;}>;
property onDidChangeValue
readonly onDidChangeValue: Event<{ quickPick: QuickPick<QuickPickItem>; filter: string;}>;
property onDidHide
readonly onDidHide: Event<void>;
property onDidTriggerButton
readonly onDidTriggerButton: Event<QuickInputButtonHandle>;
method hide
hide: () => void;
method setItems
setItems: <T extends QuickPickItem>(items: Array<T>) => void;
method show
show: <T extends QuickPickItem>( items: Array<T | QuickPickSeparator>, options?: QuickPickOptions<T>) => Promise<T | undefined>;
interface QuickPickValue
interface QuickPickValue<V> extends QuickPickItem {}
property value
value: V;
interface ReadBuffer
interface ReadBuffer {}
A buffer maintaining a read position in a buffer containing a received message capable of reading primitive values.
method readBytes
readBytes: () => Uint8Array;
method readLength
readLength: () => number;
method readNumber
readNumber: () => number;
method readString
readString: () => string;
method readUint16
readUint16: () => number;
method readUint32
readUint32: () => number;
method readUint8
readUint8: () => number;
method sliceAtReadPosition
sliceAtReadPosition: () => ReadBuffer;
Returns a new read buffer whose starting read position is the current read position of this buffer. This is useful to create read buffers sub messages. (e.g. when using a multiplexer the beginning of the message might contain some protocol overhead which should not be part of the message reader that is sent to the target channel)
interface ResolvedConnectionErrorHandlerOptions
interface ResolvedConnectionErrorHandlerOptions {}
property logger
readonly logger: ILogger;
property maxErrors
readonly maxErrors: number;
The maximum amount of errors allowed before stopping the server.
property maxRestarts
readonly maxRestarts: number;
The minimum amount of restarts allowed in the restart interval.
property restartInterval
readonly restartInterval: number;
In minutes.
property serverName
readonly serverName: string;
interface Resource
interface Resource extends Disposable {}
property autosaveable
readonly autosaveable?: boolean;
If false, the application should not attempt to auto-save this resource.
property encoding
readonly encoding?: string | undefined;
Latest read encoding of this resource.
Optional if a resource does not support encoding, check with
in
operator`. Undefined if a resource did not read content yet.
property initiallyDirty
readonly initiallyDirty?: boolean;
property onDidChangeContents
readonly onDidChangeContents?: Event<void>;
property onDidChangeReadOnly
readonly onDidChangeReadOnly?: Event<boolean | MarkdownString>;
property readOnly
readonly readOnly?: boolean | MarkdownString;
property uri
readonly uri: URI;
property version
readonly version?: ResourceVersion | undefined;
Latest read version of this resource.
Optional if a resource does not support versioning, check with
in
operator`. Undefined if a resource did not read content yet.
method guessEncoding
guessEncoding: () => Promise<string | undefined>;
method readContents
readContents: (options?: ResourceReadOptions) => Promise<string>;
Reads latest content of this resource.
If a resource supports versioning it updates version to latest. If a resource supports encoding it updates encoding to latest.
Throws
ResourceError.NotFound
if a resource not found
method readStream
readStream: (options?: ResourceReadOptions) => Promise<ReadableStream<string>>;
Stream latest content of this resource.
If a resource supports versioning it updates version to latest. If a resource supports encoding it updates encoding to latest.
Throws
ResourceError.NotFound
if a resource not found
method saveContentChanges
saveContentChanges: ( changes: TextDocumentContentChangeEvent[], options?: ResourceSaveOptions) => Promise<void>;
Applies incremental content changes to this resource.
If a resource supports versioning clients can pass some version to check against it, if it is not provided latest version is used. It updates version to latest.
Throws
ResourceError.NotFound
if a resource not found or was not read yetThrows
ResourceError.OutOfSync
if latest resource version is out of sync with the given
method saveContents
saveContents: (content: string, options?: ResourceSaveOptions) => Promise<void>;
Rewrites the complete content for this resource. If a resource does not exist it will be created.
If a resource supports versioning clients can pass some version to check against it, if it is not provided latest version is used.
It updates version and encoding to latest.
Throws
ResourceError.OutOfSync
if latest resource version is out of sync with the given
method saveStream
saveStream: ( content: Readable<string>, options?: ResourceSaveOptions) => Promise<void>;
Rewrites the complete content for this resource. If a resource does not exist it will be created.
If a resource supports versioning clients can pass some version to check against it, if it is not provided latest version is used.
It updates version and encoding to latest.
Throws
ResourceError.OutOfSync
if latest resource version is out of sync with the given
interface ResourceReadOptions
interface ResourceReadOptions {}
property encoding
encoding?: string;
interface ResourceResolver
interface ResourceResolver {}
interface ResourceSaveOptions
interface ResourceSaveOptions {}
property encoding
encoding?: string;
property overwriteEncoding
overwriteEncoding?: boolean;
property version
version?: ResourceVersion;
interface ResourceVersion
interface ResourceVersion {}
interface RpcConnectionEventEmitter
interface RpcConnectionEventEmitter {}
property onDidCloseConnection
readonly onDidCloseConnection: Event<void>;
property onDidOpenConnection
readonly onDidOpenConnection: Event<void>;
interface RpcProtocolOptions
interface RpcProtocolOptions {}
Initialization options for a RpcProtocol.
property decoder
decoder?: RpcMessageDecoder;
The message decoder that should be used. If
undefined
the default RpcMessageDecoder will be used.
property encoder
encoder?: RpcMessageEncoder;
The message encoder that should be used. If
undefined
the default RpcMessageEncoder will be used.
property mode
mode?: 'default' | 'clientOnly' | 'serverOnly';
The runtime mode determines whether the RPC protocol is bi-directional (default) or acts as a client or server only.
interface SelectionProvider
interface SelectionProvider<T> {}
SelectionProvider
is implemented by services to notify listeners about selection changes.
property onSelectionChanged
onSelectionChanged: Event<T | undefined>;
interface StructuralMenuChange
interface StructuralMenuChange extends MenuChangedEvent {}
property affectedChildId
affectedChildId: string;
property kind
kind: ChangeKind.ADDED | ChangeKind.REMOVED | ChangeKind.LINKED;
interface SubMenuOptions
interface SubMenuOptions extends Pick<MenuAction, 'order'>, Pick<MenuNodeMetadata, 'when'>, Partial<Pick<CompoundMenuNode, 'role' | 'label' | 'icon'>> {}
Additional options when creating a new submenu.
property iconClass
iconClass?: string;
The class to use for the submenu icon.
Deprecated
use
icon
instead;
interface TelemetryLogger
interface TelemetryLogger {}
property options
readonly options: TelemetryLoggerOptions | undefined;
property sender
readonly sender: TelemetrySender;
method dispose
dispose: () => void;
method logError
logError: ( eventNameOrException: string | Error, data?: Record<string, any | TelemetryTrustedValue<any>>) => void;
method logUsage
logUsage: ( eventName: string, data?: Record<string, any | TelemetryTrustedValue<any>>) => void;
interface TextDocumentContentChangeDelta
interface TextDocumentContentChangeDelta {}
property range
readonly range: Range;
property rangeLength
readonly rangeLength?: number;
property text
readonly text: string;
interface UriSelection
interface UriSelection {}
property uri
readonly uri: URI;
interface WaitUntilEvent
interface WaitUntilEvent {}
property token
token: CancellationToken;
A cancellation token.
method waitUntil
waitUntil: (thenable: Promise<any>) => void;
Allows to pause the event loop until the provided thenable resolved.
*Note:* It can only be called during event dispatch and not in an asynchronous manner
Parameter thenable
A thenable that delays execution.
interface WillExecuteCommandEvent
interface WillExecuteCommandEvent extends WaitUntilEvent, CommandEvent {}
interface WriteBuffer
interface WriteBuffer {}
A buffer maintaining a write position capable of writing primitive values
method commit
commit: () => void;
Makes any writes to the buffer permanent, for example by sending the writes over a channel. You must obtain a new write buffer after committing
method writeBytes
writeBytes: (value: Uint8Array) => this;
method writeLength
writeLength: (value: number) => this;
method writeNumber
writeNumber: (value: number) => this;
method writeRaw
writeRaw: (bytes: Uint8Array) => this;
method writeString
writeString: (value: string) => this;
method writeUint16
writeUint16: (value: number) => this;
method writeUint32
writeUint32: (value: number) => this;
method writeUint8
writeUint8: (byte: number) => this;
Enums
enum ChangeKind
enum ChangeKind { ADDED = 0, REMOVED = 1, CHANGED = 2, LINKED = 3,}
enum CompoundMenuNodeRole
const enum CompoundMenuNodeRole { Submenu = 0, Group = 1, Flat = 2,}
member Flat
Flat = 2
Indicates that the node's children should be treated as though they were direct children of the node's parent
member Group
Group = 1
Indicates that the node's children should be rendered as group separated from other items by a separator
member Submenu
Submenu = 0
Indicates that the node should be rendered as submenu that opens a new menu on hover
enum LogLevel
enum LogLevel { FATAL = 60, ERROR = 50, WARN = 40, INFO = 30, DEBUG = 20, TRACE = 10,}
enum MessageType
enum MessageType { Error = 1, Warning = 2, Info = 3, Log = 4, Progress = 5,}
enum QuickInputHideReason
enum QuickInputHideReason { Blur = 1, Gesture = 2, Other = 3,}
enum ViewColumn
enum ViewColumn { Active = -1, Beside = -2, One = 1, Two = 2, Three = 3, Four = 4, Five = 5, Six = 6, Seven = 7, Eight = 8, Nine = 9,}
Denotes a column in the editor window. Columns are used to show editors side by side.
Type Aliases
type Bindable
type Bindable = interfaces.Bind | interfaces.Container;
type CMD
type CMD = [string, string[]];
type ConnectionErrorHandlerOptions
type ConnectionErrorHandlerOptions = Partial<ResolvedConnectionErrorHandlerOptions> & { readonly serverName: string; readonly logger: ILogger; };
type ContributionType
type ContributionType = interfaces.ServiceIdentifier<any>;
type Deferred
type Deferred<T> = { [P in keyof T]: Promise<T[P]>;};
type DisposableGroup
type DisposableGroup = | { push(disposable: Disposable): void; } | { add(disposable: Disposable): void; };
type Filter
type Filter<T extends Object> = (toTest: T) => boolean;
Parameter toTest
Object that should be tested
Returns
true
if the object passes the test,false
otherwise.
type JsonRpcConnectionEventEmitter
type JsonRpcConnectionEventEmitter = RpcConnectionEventEmitter;
Deprecated
since 1.39.0 use
RpcConnectionEventEmitter
instead
type JsonRpcProxy
type JsonRpcProxy<T> = RpcProxy<T>;
Deprecated
since 1.39.0 use
RpcProxy
instead
type JsonRpcServer
type JsonRpcServer<Client> = RpcServer<Client>;
Deprecated
since 1.39.0 use
RpcServer
instead
type Log
type Log = (message: any, ...params: any[]) => void;
type Loggable
type Loggable = (log: Log) => void;
type LoggerFactory
type LoggerFactory = (name: string) => ILogger;
type MaybeArray
type MaybeArray<T> = T | T[];
type MaybeNull
type MaybeNull<T> = { [P in keyof T]: T[P] | null;};
type MaybePromise
type MaybePromise<T> = T | PromiseLike<T>;
type MaybeUndefined
type MaybeUndefined<T> = { [P in keyof T]?: T[P] | undefined;};
type MenuCommandArguments
type MenuCommandArguments = [ menuPath: MenuPath, command: string, ...commandArgs: unknown[]];
type MenuNode
type MenuNode = MenuNodeMetadata & MenuNodeRenderingData & Partial<CompoundMenuNode> & Partial<CommandMenuNode> & Partial<AlternativeHandlerMenuNode>;
Base interface of the nodes used in the menu tree structure.
type MenuPath
type MenuPath = string[];
type MessageProvider
type MessageProvider = () => ReadBuffer;
The
MessageProvider
is emitted when a channel receives a new message. Listeners can invoke the provider to obtain a new ReadBuffer for the received message. This ensures that each listener has its own isolated ReadBuffer instance.
type Mutable
type Mutable<T> = { -readonly [P in keyof T]: T[P];};
type QuickPickInput
type QuickPickInput<T = QuickPickItem> = T | QuickPickSeparator;
type QuickPickItemOrSeparator
type QuickPickItemOrSeparator = QuickPickItem | QuickPickSeparator;
type QuickPicks
type QuickPicks = (QuickPickSeparator | QuickPickItem)[];
type RecursivePartial
type RecursivePartial<T> = { [P in keyof T]?: T[P] extends (infer I)[] ? RecursivePartial<I>[] : RecursivePartial<T[P]>;};
type RemoteMeasurement
type RemoteMeasurement = number;
Token representing a remote measurement in the BackendStopwatch protocol.
type RequestHandler
type RequestHandler = (method: string, args: any[]) => Promise<any>;
Handles request messages received by the RPCProtocol.
type ResourceProvider
type ResourceProvider = (uri: URI) => Promise<Resource>;
type RpcProtocolFactory
type RpcProtocolFactory = ( channel: Channel, requestHandler: RequestHandler) => RpcProtocol;
Factory for creating a new RpcProtocol for a given chanel and RequestHandler.
type RpcProxy
type RpcProxy<T> = T & RpcConnectionEventEmitter;
type RpcServer
type RpcServer<Client> = Disposable & { /** * If this server is a proxy to a remote server then * a client is used as a local object * to handle RPC messages from the remote server. */ setClient(client: Client | undefined): void; getClient?(): Client | undefined;};
type WaitUntilData
type WaitUntilData<T> = Omit<T, 'waitUntil' | 'token'>;
Namespaces
namespace ApplicationError
namespace ApplicationError {}
function declare
declare: <C extends number, D>( code: C, factory: (...args: any[]) => Literal<D>) => Constructor<C, D>;
function fromJson
fromJson: <C extends number, D>( code: C, raw: Literal<D>) => ApplicationError<C, D>;
function is
is: <C extends number, D>( arg: object | undefined) => arg is ApplicationError<C, D>;
interface Constructor
interface Constructor<C extends number, D> {}
property code
code: C;
method is
is: (arg: object | undefined) => arg is ApplicationError<C, D>;
call signature
(...args: any[]): ApplicationError<C, D>;
namespace ArrayUtils
namespace ArrayUtils {}
variable HeadAndChildrenImpl
const HeadAndChildrenImpl: { head<T>(this: T[]): T; children<T_1>(this: T_1[]): Tail<T_1>;};
variable TailImpl
const TailImpl: { tail<T>(this: T[]): T };
function asHeadAndTail
asHeadAndTail: <T>(array: Array<T>) => HeadAndTail<T>;
function asTail
asTail: <T>(array: Array<T>) => Tail<T>;
function binarySearch2
binarySearch2: ( length: number, compareToKey: (index: number) => number) => number;
Performs a binary search algorithm over a sorted collection. Useful for cases when we need to perform a binary search over something that isn't actually an array, and converting data to an array would defeat the use of binary search in the first place.
Parameter length
The collection length.
Parameter compareToKey
A function that takes an index of an element in the collection and returns zero if the value at this index is equal to the search key, a negative number if the value precedes the search key in the sorting order, or a positive number if the search key precedes the value. A non-negative index of an element, if found. If not found, the result is -(n+1) (or ~n, using bitwise notation), where n is the index where the key should be inserted to maintain the sorting order.
function coalesce
coalesce: <T>(array: ReadonlyArray<T | undefined | null>) => T[];
Returns
New array with all falsy values removed. The original array IS NOT modified.
function groupBy
groupBy: <T>(data: ReadonlyArray<T>, compare: (a: T, b: T) => number) => T[][];
groups array elements through a comparator function
Parameter data
array of elements to group
Parameter compare
comparator function: return of 0 means should group, anything above means not group
Returns
array of arrays with grouped elements
function partition
partition: <T>( array: T[], filter: (e: T, idx: number, arr: T[]) => boolean | undefined) => [T[], T[]];
function shallowEqual
shallowEqual: <T>(left: readonly T[], right: readonly T[]) => boolean;
function startsWith
startsWith: <T>(left: readonly T[], right: readonly T[]) => boolean;
interface HeadAndTail
interface HeadAndTail<T> extends Head<T>, Tail<T>, Children<T> {}
enum Sort
enum Sort { LeftBeforeRight = -1, RightBeforeLeft = 1, Equal = 0,}
member Equal
Equal = 0
member LeftBeforeRight
LeftBeforeRight = -1
member RightBeforeLeft
RightBeforeLeft = 1
namespace Bindable
namespace Bindable {}
function isContainer
isContainer: (arg: Bindable) => arg is interfaces.Container;
namespace CancellationToken
namespace CancellationToken {}
namespace Command
namespace Command {}
function compareCommands
compareCommands: (a: Command, b: Command) => number;
Comparator function for when sorting commands
function equals
equals: (a: Command, b: Command) => boolean;
Determine if two commands are equal.
Parameter a
the first command for comparison.
Parameter b
the second command for comparison.
function is
is: (arg: unknown) => arg is Command;
function toDefaultLocalizedCommand
toDefaultLocalizedCommand: (command: Command) => Command;
function toLocalizedCommand
toLocalizedCommand: ( command: Command, nlsLabelKey?: string, nlsCategoryKey?: string) => Command;
Utility function to easily translate commands
namespace CommandMenuNode
namespace CommandMenuNode {}
function hasAltHandler
hasAltHandler: (candidate?: MenuNode) => candidate is AlternativeHandlerMenuNode;
function is
is: (candidate?: MenuNode) => candidate is CommandMenuNode;
namespace CompoundMenuNode
namespace CompoundMenuNode {}
function getFlatChildren
getFlatChildren: (children: ReadonlyArray<MenuNode>) => MenuNode[];
Collapses the children of any subemenus with role and sorts
function getRole
getRole: (node: MenuNode) => CompoundMenuNodeRole | undefined;
function is
is: (node?: MenuNode) => node is CompoundMenuNode;
function isMutable
isMutable: (node?: MenuNode) => node is MutableCompoundMenuNode;
function isNavigationGroup
isNavigationGroup: (node: MenuNode) => node is CompoundMenuNode;
Indicates whether the given node is the special
navigation
menu.Parameter node
the menu node to check.
Returns
true
when the given node is a CompoundMenuNode with idnavigation
,false
otherwise.
function sortChildren
sortChildren: (m1: MenuNode, m2: MenuNode) => number;
namespace Disposable
namespace Disposable {}
namespace DisposableGroup
namespace DisposableGroup {}
namespace Event
namespace Event {}
variable None
const None: Event<any>;
function addMaxListeners
addMaxListeners: (event: Event<unknown>, add: number) => number;
function any
any: { <T>(...events: Event<T>[]): Event<T>; (...events: Event<any>[]): Event<void>;};
Given a collection of events, returns a single event which emits whenever any of the provided events emit.
function filter
filter: { <T>(event: Event<T>, predicate: (e: T) => unknown): Event<T>; <T, S extends T>(event: Event<T>, predicate: (e: T) => e is S): Event<S>;};
function getMaxListeners
getMaxListeners: (event: Event<unknown>) => number;
function map
map: <I, O>(event: Event<I>, mapFunc: (i: I) => O) => Event<O>;
Given an event and a
map
function, returns another event which maps each element through the mapping function.
function once
once: <T>(event: Event<T>) => Event<T>;
Given an event, returns another event which only fires once.
function setMaxListeners
setMaxListeners: <N extends number>(event: Event<unknown>, maxListeners: N) => N;
function toPromise
toPromise: <T>(event: Event<T>) => Promise<T>;
namespace file-icons-js
module 'file-icons-js' {}
function getClass
getClass: (filePath: string) => string;
function getClassWithColor
getClassWithColor: (filePath: string) => string;
namespace LogLevel
namespace LogLevel {}
variable strings
const strings: Map<LogLevel, string>;
function fromString
fromString: (levelStr: string) => LogLevel | undefined;
function toString
toString: (level: LogLevel) => string | undefined;
namespace MenuAction
namespace MenuAction {}
function is
is: (arg: unknown) => arg is MenuAction;
namespace native-keymap
module 'native-keymap' {}
function getCurrentKeyboardLayout
getCurrentKeyboardLayout: () => IKeyboardLayoutInfo;
function getKeyMap
getKeyMap: () => IKeyboardMapping;
function isISOKeyboard
isISOKeyboard: () => boolean;
function onDidChangeKeyboardLayout
onDidChangeKeyboardLayout: (callback: () => void) => void;
interface ILinuxKeyboardLayoutInfo
interface ILinuxKeyboardLayoutInfo {}
interface ILinuxKeyboardMapping
interface ILinuxKeyboardMapping {}
index signature
[code: string]: ILinuxKeyMapping;
interface ILinuxKeyMapping
interface ILinuxKeyMapping {}
property value
value: string;
property withAltGr
withAltGr: string;
property withShift
withShift: string;
property withShiftAltGr
withShiftAltGr: string;
interface IMacKeyboardLayoutInfo
interface IMacKeyboardLayoutInfo {}
interface IMacKeyboardMapping
interface IMacKeyboardMapping {}
index signature
[code: string]: IMacKeyMapping;
interface IMacKeyMapping
interface IMacKeyMapping {}
property value
value: string;
property valueIsDeadKey
valueIsDeadKey: boolean;
property withAltGr
withAltGr: string;
property withAltGrIsDeadKey
withAltGrIsDeadKey: boolean;
property withShift
withShift: string;
property withShiftAltGr
withShiftAltGr: string;
property withShiftAltGrIsDeadKey
withShiftAltGrIsDeadKey: boolean;
property withShiftIsDeadKey
withShiftIsDeadKey: boolean;
interface IWindowsKeyboardLayoutInfo
interface IWindowsKeyboardLayoutInfo {}
interface IWindowsKeyboardMapping
interface IWindowsKeyboardMapping {}
index signature
[code: string]: IWindowsKeyMapping;
interface IWindowsKeyMapping
interface IWindowsKeyMapping {}
property value
value: string;
property vkey
vkey: string;
property withAltGr
withAltGr: string;
property withShift
withShift: string;
property withShiftAltGr
withShiftAltGr: string;
type IKeyboardLayoutInfo
type IKeyboardLayoutInfo = | IWindowsKeyboardLayoutInfo | ILinuxKeyboardLayoutInfo | IMacKeyboardLayoutInfo;
type IKeyboardMapping
type IKeyboardMapping = | IWindowsKeyboardMapping | ILinuxKeyboardMapping | IMacKeyboardMapping;
namespace nls
namespace nls {}
variable defaultLocale
const defaultLocale: string;
variable locale
const locale: string;
variable localeId
const localeId: string;
variable localization
let localization: Localization;
function getDefaultKey
getDefaultKey: (defaultValue: string) => string;
function isSelectedLocale
isSelectedLocale: (id: string) => boolean;
function localize
localize: (key: string, defaultValue: string, ...args: FormatType[]) => string;
function localizeByDefault
localizeByDefault: (defaultValue: string, ...args: FormatType[]) => string;
Automatically localizes a text if that text also exists in the vscode repository.
function setLocale
setLocale: (id: string) => void;
namespace OS
namespace OS {}
namespace Path
namespace Path {}
namespace Prioritizeable
namespace Prioritizeable {}
function compare
compare: <T>(p: Prioritizeable<T>, p2: Prioritizeable<T>) => number;
function isValid
isValid: <T>(p: Prioritizeable<T>) => boolean;
function prioritizeAll
prioritizeAll: <T>( values: MaybePromise<T>[], getPriority: GetPriority<T>) => Promise<Prioritizeable<T>[]>;
function prioritizeAllSync
prioritizeAllSync: <T>( values: T[], getPriority: GetPrioritySync<T>) => Prioritizeable<T>[];
function toPrioritizeable
toPrioritizeable: { <T>(rawValue: MaybePromise<T>, getPriority: GetPriority<T>): Promise< Prioritizeable<T> >; <T>(rawValue: MaybePromise<T>[], getPriority: GetPriority<T>): Promise< Prioritizeable<T>[] >;};
function toPrioritizeableSync
toPrioritizeableSync: <T>( rawValue: T[], getPriority: GetPrioritySync<T>) => Prioritizeable<T>[];
type GetPriority
type GetPriority<T> = (value: T) => MaybePromise<number>;
type GetPrioritySync
type GetPrioritySync<T> = (value: T) => number;
namespace ProgressMessage
namespace ProgressMessage {}
variable Cancel
const Cancel: string;
function isCancelable
isCancelable: (message: ProgressMessage) => boolean;
namespace QuickPickItem
namespace QuickPickItem {}
function is
is: (item: QuickPickSeparator | QuickPickItem) => item is QuickPickItem;
namespace QuickPickSeparator
namespace QuickPickSeparator {}
function is
is: (item: QuickPickItemOrSeparator) => item is QuickPickSeparator;
namespace Resource
namespace Resource {}
function save
save: ( resource: Resource, context: SaveContext, token?: CancellationToken) => Promise<void>;
function shouldSaveContent
shouldSaveContent: ( resource: Resource, { contentLength, changes }: SaveContext) => boolean;
function trySaveContentChanges
trySaveContentChanges: ( resource: Resource, context: SaveContext) => Promise<boolean>;
interface SaveContext
interface SaveContext {}
property changes
changes?: TextDocumentContentChangeEvent[];
property content
content: string | Readable<string>;
property contentLength
contentLength: number;
property options
options?: ResourceSaveOptions;
namespace ResourceError
namespace ResourceError {}
namespace StructuralMenuChange
namespace StructuralMenuChange {}
function is
is: (evt: MenuChangedEvent) => evt is StructuralMenuChange;
namespace TextDocumentContentChangeDelta
namespace TextDocumentContentChangeDelta {}
function is
is: (arg: unknown) => arg is TextDocumentContentChangeDelta;
namespace UriSelection
namespace UriSelection {}
namespace WaitUntilEvent
namespace WaitUntilEvent {}
function fire
fire: <T extends WaitUntilEvent>( emitter: Emitter<T>, event: WaitUntilData<T>, timeout?: number, token?: CancellationToken) => Promise<void>;
Fire all listeners in the same tick.
Use
AsyncEmitter.fire
to fire listeners async one after another.
Package Files (52)
- lib/common/application-error.d.ts
- lib/common/array-utils.d.ts
- lib/common/cancellation.d.ts
- lib/common/command.d.ts
- lib/common/contribution-filter/contribution-filter-registry.d.ts
- lib/common/contribution-filter/contribution-filter.d.ts
- lib/common/contribution-filter/filter.d.ts
- lib/common/contribution-provider.d.ts
- lib/common/disposable.d.ts
- lib/common/event.d.ts
- lib/common/index.d.ts
- lib/common/logger-protocol.d.ts
- lib/common/logger.d.ts
- lib/common/lsp-types.d.ts
- lib/common/menu/action-menu-node.d.ts
- lib/common/menu/composite-menu-node.d.ts
- lib/common/menu/menu-adapter.d.ts
- lib/common/menu/menu-model-registry.d.ts
- lib/common/menu/menu-types.d.ts
- lib/common/message-rpc/channel.d.ts
- lib/common/message-rpc/message-buffer.d.ts
- lib/common/message-rpc/rpc-protocol.d.ts
- lib/common/message-service-protocol.d.ts
- lib/common/message-service.d.ts
- lib/common/messaging/connection-error-handler.d.ts
- lib/common/messaging/handler.d.ts
- lib/common/messaging/proxy-factory.d.ts
- lib/common/nls.d.ts
- lib/common/numbers.d.ts
- lib/common/objects.d.ts
- lib/common/os.d.ts
- lib/common/path.d.ts
- lib/common/performance/measurement-protocol.d.ts
- lib/common/performance/measurement.d.ts
- lib/common/performance/stopwatch.d.ts
- lib/common/prioritizeable.d.ts
- lib/common/progress-service-protocol.d.ts
- lib/common/progress-service.d.ts
- lib/common/quick-pick-service.d.ts
- lib/common/reference.d.ts
- lib/common/resource.d.ts
- lib/common/selection-service.d.ts
- lib/common/selection.d.ts
- lib/common/strings.d.ts
- lib/common/telemetry.d.ts
- lib/common/types.d.ts
- lib/common/uri.d.ts
- lib/common/uuid.d.ts
- lib/common/version.d.ts
- lib/common/view-column.d.ts
- src/browser/file-icons-js.d.ts
- src/typings/native-keymap.d.ts
Dependencies (70)
- @babel/runtime
- @lumino/algorithm
- @lumino/commands
- @lumino/coreutils
- @lumino/domutils
- @lumino/dragdrop
- @lumino/messaging
- @lumino/properties
- @lumino/signaling
- @lumino/virtualdom
- @lumino/widgets
- @parcel/watcher
- @theia/application-package
- @theia/request
- @types/body-parser
- @types/cookie
- @types/dompurify
- @types/express
- @types/fs-extra
- @types/lodash.debounce
- @types/lodash.throttle
- @types/markdown-it
- @types/react
- @types/react-dom
- @types/route-parser
- @types/safer-buffer
- @types/uuid
- @types/ws
- @types/yargs
- @vscode/codicons
- ajv
- async-mutex
- body-parser
- cookie
- dompurify
- drivelist
- es6-promise
- express
- fast-json-stable-stringify
- file-icons-js
- font-awesome
- fs-extra
- fuzzy
- http-proxy-agent
- https-proxy-agent
- iconv-lite
- inversify
- jschardet
- keytar
- lodash.debounce
- lodash.throttle
- markdown-it
- msgpackr
- p-debounce
- perfect-scrollbar
- react
- react-dom
- react-tooltip
- react-virtuoso
- reflect-metadata
- route-parser
- safer-buffer
- socket.io
- socket.io-client
- tslib
- uuid
- vscode-languageserver-protocol
- vscode-uri
- ws
- yargs
Dev Dependencies (4)
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@theia/core
.
- Markdown[](https://www.jsdocs.io/package/@theia/core)
- HTML<a href="https://www.jsdocs.io/package/@theia/core"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 20566 ms. - Missing or incorrect documentation? Open an issue for this package.