Define the action of the menu item, when specified the click
property will
be ignored. See roles.
Object that should be tested
true
if the object passes the test, false
otherwise.
Base interface of the nodes used in the menu tree structure.
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.
Union of all possible key/value pairs for a type T
Typesafe schema-based preferences utility based on the PreferenceService. Can be used to get preferences as well as listen to preference changes.
See createPreferenceProxy on how to instantiate preference proxies.
preferences.onPreferenceChanged(({ preferenceName, newValue }) => { ... });
const enabled = preferences['myext.enabled'];
Token representing a remote measurement in the BackendStopwatch protocol.
Handles request messages received by the RPCProtocol.
This code lets you encode rpc protocol messages (request/reply/notification/error/cancel) into a channel write buffer and decode the same messages from a read buffer. Custom encoders/decoders can be registered to specially handling certain types of values to be encoded. Clients are responsible for ensuring that the set of tags for encoders is distinct and the same at both ends of a channel.
Factory for creating a new RpcProtocol for a given chanel and RequestHandler.
It provides bindings which are scoped per a connection, e.g. in order to allow backend services to access frontend service within the same connection.
const myConnectionModule = ConnectionContainerModule.create(({ bindFrontendService }) => {
bindFrontendService(myFrontendServicePath, MyFrontendService);
});
export const myBackendApplicationModule = new ContainerModule(bind => {
bind(ConnectionContainerModule).toConstantValue(myConnectionModule);
}
const myConnectionModule2 = ConnectionContainerModule.create(({ bind, bindBackendService }) => {
bind(MyBackendService).toSelf().inSingletonScope();
bindBackendService(myBackendServicePath, MyBackendService);
});
export const myBackendApplicationModule2 = new ContainerModule(bind => {
bind(ConnectionContainerModule).toConstantValue(myConnectionModule2);
}
@injectable()
export class MyBackendService {
@inject(MyFrontendService)
protected readonly myFrontendService: MyFrontendService;
}
Service for listening on backend connection changes.
This is the fallback keyboard layout selected when nothing else matches. It has an empty mapping, so user inputs are handled like with a standard US keyboard.
The window hash value that is used to spawn a new default window.
Electron-IPC-specific connection handler. Use this if you want to establish communication between the frontend and the electron-main process.
The default entrypoint will handle a very rudimentary CLI to open workspaces by doing app path/to/workspace
. To override this behavior, you can extend and rebind the
ElectronMainApplication
class and overriding the launch
method.
A JSON-RPC communication between the Electron Main Process and the Renderer Processes is available: You can bind services using the ElectronConnectionHandler
and
ElectronIpcConnectionProvider
APIs, example:
From an electron-main
module:
bind(ElectronConnectionHandler).toDynamicValue(context =>
new JsonRpcConnectionHandler(electronMainWindowServicePath,
() => context.container.get(ElectronMainWindowService))
).inSingletonScope();
And from the electron-browser
module:
bind(ElectronMainWindowService).toDynamicValue(context =>
ElectronIpcConnectionProvider.createProxy(context.container, electronMainWindowServicePath)
).inSingletonScope();
This token is unique to the current running instance. It is used by the backend to make sure it is an electron browser window that is connecting to its services.
The identifier is a string, which makes it usable as a key for cookies, environments, etc.
Clients can implement to get a callback for contributing widgets to a shell on start.
The class name added to the left and right area panels.
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.
Use this directly if you aren't worried about circular dependencies in the Shell
Use this to avoid circular dependencies in the Shell
Bind components to this symbol to subscribe to WebSocket events.
Items whose group is exactly 'navigation' will be rendered inline.
We cannot load providers directly in the case if they depend on PreferenceService
somehow.
It allows to load them lazily after DI is configured.
Menu path for tab bars used throughout the application shell.
Search box factory.
Clients should implement this interface if they want to contribute to the tab-bar toolbar.
Factory for instantiating tab-bar toolbars.
The tree model.
The tree selection service.
Service for opening new browser windows.
Bind components to this symbol to filter WebSocket connections.
When a version is increased, make sure to introduce a migration (ApplicationShellLayoutMigration) to this version.
The default tree properties.
IMPORTANT: don't use in tests, since it overrides console
The native path separator depending on the OS.
The forward slash path separator.
API path of the stopwatch service that exposes the back-end stopwatch to clients.
Resolves after the next animation frame if no parameter is given, or after the given number of animation frames.
the base name of a path.
Helper function to bind a service to a list of contributions easily.
a Container or the bind function directly.
an already bound service to refer the contributions to.
array of contribution identifiers to bind the service to.
Exit the current process if the parent process is not alive. Relevant only for some OS, like Windows
the length of the common prefix of the two strings.
Helper to fully read a T stream into a T.
Helper to read a T stream up to a maximum of chunks. If the limit is reached, will return a stream instead to ensure all data can still be read.
If a collection is passed in, the new disposable is added to that collection. Otherwise, the new disposable is returned.
Creates a preference proxy for typesafe preference handling.
the underlying preference service to use for preference handling.
the JSON Schema which describes which preferences are available including types and descriptions. Can be a promise.
configuration options.
the created preference proxy.
createPreferenceProxy
to make your preferences available wherever needed.See CorePreferences for an example.
Note that if schema
is a Promise, most actions will be no-ops until the promise is resolved.
A function to allow a promise resolution to be delayed by a number of milliseconds. Usage is as follows:
const stringValue = await myPromise.then(delay(600)).then(value => value.toString());
the number of millisecond to delay
a function that returns a promise that returns the given value, but delayed
A function to allow a promise resolution to be delayed by a number of milliseconds. Usage is as follows:
const stringValue = await myPromise.then(delay(600)).then(value => value.toString());
a function that returns a promise that returns the given value, but delayed
const disableJSDOM = enableJSDOM();
// actions require DOM
disableJSDOM();
const disableJSDOM = enableJSDOM();
// actions require DOM
disableJSDOM();
Determines if haystack ends with needle.
Escapes regular expression characters in a given string
.far
from boo.far
or the empty string.
Filter the list of quick pick items based on the provided filter. Items are filtered based on if:
label
satisfies the filter using fuzzy
.description
satisfies the filter using fuzzy
.detail
satisfies the filter using fuzzy
.
Filtered items are also updated to display proper highlights based on how they were filtered.the list of quick pick items.
the filter to search for.
the list of quick pick items that satisfy the filter.
Find match highlights when testing a word against a pattern.
the word to test.
the word to match against.
the list of highlights if present.
Computes the root this path, like getRoot('c:\files') === c:\
,
getRoot('files:///files/path') === files:///
,
or getRoot('\\server\shares\path') === \\server\shares\
value to check.
optional predicate ran on every element of the array.
value to substitute this
with when invoking in the predicate.
whether or not value
is an array.
true
if the argument is an empty object. Otherwise, false
.
Simplified glob matching. Supports a subset of glob patterns:
Creates a shallow copy with all ownkeys of the original object that are null
made undefined
Simplified glob matching. Supports a subset of glob patterns:
Parse a magnitude value (e.g. width, height, left, top) from a CSS attribute value.
Returns the given default value (or undefined) if the value cannot be determined,
e.g. because it is a relative value like 50%
or auto
.
Parse the number of milliseconds from a CSS time value. Returns the given default value (or undefined) if the value cannot be determined.
Same as parse
, but the ParsedExpression is guaranteed to return a Promise
Helper to peek up to maxChunks
into a stream. The return type signals if
the stream has ended or not. If not, caller needs to add a data
listener
to continue reading.
Prevent browser back/forward navigation of a mouse wheel event.
Remove all references to a module from Node's module cache.
callback to filter modules from the cache: return true
to remove the module from the cache.
resolves after a specified number of milliseconds
Creates a promise that is rejected after the given amount of time. A typical use case is to wait for another promise until a specified timeout using:
Promise.race([ promiseToPerform, timeoutReject(timeout, 'Timeout error message') ]);
timeout in milliseconds
error message on promise rejection
rejection promise
Helper to convert a T into a Readable
Helper to create a readable stream from an existing T.
Helper to transform a readable stream into another stream.
Throws when called and statically makes sure that all variants of a type were consumed.
Counterpart of the #setRootLogger(ILogger)
. Restores the console.xxx
bindings to the original one.
Invoking has no side-effect if setRootLogger
was not called before. Multiple function invocation has
no side-effect either.
Constructs a promise that will resolve after a given delay.
the number of milliseconds to wait
Resolves when the given widget is detached and hidden.
Resolves when the given widget is hidden regardless of attachment.
Resolves when the given widget is attached and visible.
Either be a reference to an existing color or a color value as a hex string, rgba, or hsla.