mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
Hook up provider mechanism and add onClick
This commit is contained in:
@@ -1,19 +1,35 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { ITreeNode } from 'vscode';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import {ExtHostContext, MainThreadExplorersShape, ExtHostExplorersShape} from './extHost.protocol';
|
||||
import {ITreeExplorerViewletService} from 'vs/workbench/parts/explorers/browser/treeExplorerViewletService';
|
||||
|
||||
export class MainThreadExplorers extends MainThreadExplorersShape {
|
||||
private _proxy: ExtHostExplorersShape;
|
||||
|
||||
constructor(
|
||||
@IThreadService threadService: IThreadService
|
||||
@IThreadService threadService: IThreadService,
|
||||
@ITreeExplorerViewletService private treeExplorerViewletService: ITreeExplorerViewletService
|
||||
) {
|
||||
super();
|
||||
|
||||
this._proxy = threadService.get(ExtHostContext.ExtHostExplorers);
|
||||
}
|
||||
|
||||
$registerTreeContentProvider(treeContentProviderId: string): void {
|
||||
const tree = this._proxy.$provideTextDocumentContent(treeContentProviderId);
|
||||
$registerTreeContentProvider(providerId: string): void {
|
||||
this.treeExplorerViewletService.registerTreeContentProvider(providerId, {
|
||||
provideTreeContent: (): TPromise<ITreeNode> => {
|
||||
return this._proxy.$provideTreeContent(providerId).then(jsonTree => {
|
||||
return <ITreeNode>JSON.parse(jsonTree);
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$unregisterTreeContentProvider(treeContentProviderId: string): void {
|
||||
|
||||
Reference in New Issue
Block a user