-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test contributing timeline providers from extensions #89385
Labels
Milestone
Comments
This was referenced Jan 28, 2020
I can't get the API to work. With the following ext code: import * as vscode from 'vscode';
const backups: { [uri: string]: string[] } = {};
export function activate(context: vscode.ExtensionContext) {
console.log('activate');
context.subscriptions.push(vscode.workspace.onDidSaveTextDocument(d => {
const uri = d.uri.toString();
if (backups[uri] === undefined) {
backups[uri] = [];
}
backups[uri].push(d.getText());
console.log('backed up');
}));
const changeEmitter = new vscode.EventEmitter<vscode.Uri | undefined>();
context.subscriptions.push(vscode.workspace.registerTimelineProvider('*', {
source: 'my-magical-timeline-provider',
sourceDescription: 'My magical timeline provider',
provideTimeline: (uri: vscode.Uri, token: vscode.CancellationToken) => {
console.log('provide');
const result: vscode.TimelineItem[] = [
new (vscode.TimelineItem as any)('rawr', Date.now())
];
return result;
},
onDidChange: changeEmitter.event
}));
} backed up gets logged but not provide: |
This was referenced Jan 28, 2020
Tried again and still having problems, closing off as I'm blocked. Hopefully the root cause of the problem will surface before the API is stabilized. |
2 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Refs: #84297
Complexity: 4
Testing
Extensions can now contribute timeline providers to show time-series information in a new Timeline view in the Explorer sidebar.
Develop an extension that can contribute a
TimelineProvider
to provide time-series information given aUri
. Here is an example provider.Here is the current API declarations:
vscode/src/vs/vscode.proposed.d.ts
Lines 1473 to 1565 in 4f42834
onDidChange
) and ensure the view is updatedreplaceable
totrue
and then register a replacement provider using the samesource
-- it should replace the existing one. Also try the same thing without settingreplaceable
(or set tofalse
) and the second registration should error out.Notes
DocumentSelector
as part of theregisterTimelineProvider
call isn't yet honoredThe text was updated successfully, but these errors were encountered: