Interface IWidgetLSPAdapterTracker<T>

A tracker that tracks WidgetLSPAdapters.

T - The type of widget being tracked. Defaults to WidgetLSPAdapter.

interface IWidgetLSPAdapterTracker<
    T extends WidgetLSPAdapter = WidgetLSPAdapter,
> {
    adapterAdded: ISignal<IWidgetLSPAdapterTracker<T>, T>;
    adapterUpdated: ISignal<IWidgetLSPAdapterTracker<T>, T>;
    currentAdapter: null | T;
    currentChanged: ISignal<IWidgetLSPAdapterTracker<T>, null | T>;
    isDisposed: boolean;
    size: number;
    dispose(): void;
    filter(fn: (obj: T) => boolean): T[];
    find(fn: (obj: T) => boolean): undefined | T;
    forEach(fn: (obj: T) => void): void;
    has(obj: T): boolean;
}

Type Parameters

Hierarchy

Implemented by

Properties

A signal emitted when an adapter is added.

adapterUpdated: ISignal<IWidgetLSPAdapterTracker<T>, T>

A signal emitted when a adapter is updated.

currentAdapter: null | T

The current adapter is the most recently focused or added adapter.

It is the most recently focused adapter, or the most recently added adapter if no adapter has taken focus.

currentChanged: ISignal<IWidgetLSPAdapterTracker<T>, null | T>

A signal emitted when the current instance changes.

If the last instance being tracked is disposed, null will be emitted.

isDisposed: boolean

Test whether the object has been disposed.

This property is always safe to access.

size: number

The number of instances held by the tracker.

Methods

  • Dispose of the resources held by the object.

    If the object's dispose method is called more than once, all calls made after the first will be a no-op.

    It is undefined behavior to use any functionality of the object after it has been disposed unless otherwise explicitly noted.

    Returns void

  • Filter the instances in the tracker based on a predicate.

    Parameters

    • fn: (obj: T) => boolean

      The function by which to filter.

    Returns T[]

  • Find the first instance in the tracker that satisfies a filter function.

    Parameters

    • fn: (obj: T) => boolean

      The filter function to call on each instance.

      If nothing is found, the value returned is undefined.

    Returns undefined | T

  • Iterate through each instance in the tracker.

    Parameters

    • fn: (obj: T) => void

      The function to call on each instance.

    Returns void

  • Check if this tracker has the specified instance.

    Parameters

    • obj: T

      The object whose existence is being checked.

    Returns boolean