Skip to content

Timeline items never show #91400

Closed
Closed

Description

@alexr00

Testing #91330

I made a simple provider, but none of the timeline events show up. The timeline view says that there is no timeline for the file, and when I hit refresh, it says that the timeline is loading.
There is this error in the console:

ERR Cannot read property 'map' of undefined: TypeError: Cannot read property 'map' of undefined
	at Object.provideTimeline (c:\Users\alros\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:660:139)

My simple extension:

export class TimelineProvider implements vscode.TimelineProvider {
    private static items: vscode.TimelineItem[] = [];

    private _onDidChange = new vscode.EventEmitter<vscode.TimelineChangeEvent>();
    get onDidChange(): vscode.Event<vscode.TimelineChangeEvent> {
        return this._onDidChange.event;
    }

    readonly id = 'counting-timeline-provider';
    readonly label = 'Let\s count';

    constructor() {
        setInterval(() => {
            const item: vscode.TimelineItem = new vscode.TimelineItem('item ' + TimelineProvider.items.length, new Date().getTime());
            item.command = { title: 'Toggle', command: 'workbench.action.toggleDevTools' };
            item.description = 'This is the description of ' + TimelineProvider.items.length;
            TimelineProvider.items.push(item);
            this._onDidChange.fire();
        }, 4000);
    }


    async provideTimeline(uri: vscode.Uri, token: vscode.CancellationToken): Promise<vscode.TimelineItem[]> {
        return TimelineProvider.items;
    }
}

Activity

  1. eamodio commented on Feb 26, 2020

    @eamodio
    Contributor

    Alex Ross (@alexr00) It doesn't look like you aren't using the up-to-date d.ts -- because you can't just return an array from provideTimeline anymore.

  2. added
    info-needed
    timeline
    on Feb 26, 2020
  3. locked and limited conversation to collaborators on Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

info-neededtimeline

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions