本文整理汇总了TypeScript中vscode.window.createTreeView方法的典型用法代码示例。如果您正苦于以下问题:TypeScript window.createTreeView方法的具体用法?TypeScript window.createTreeView怎么用?TypeScript window.createTreeView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vscode.window
的用法示例。
在下文中一共展示了window.createTreeView方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: activate
export async function activate (context: ExtensionContext): Promise<void> {
// Misc.
Utils.ExtensionPath = context.extensionPath;
// Connect sockets
Sockets.Connect();
// Workspace
// context.subscriptions.push(workspace.registerFileSystemProvider('babylonjs-editor', new CustomFileSystem(), { isCaseSensitive: true, isReadonly: false }));
// workspace.updateWorkspaceFolders(0, 0, { uri: Uri.parse('babylonjs-editor:/'), name: "BabylonJSEditor" });
// Workspace
const fs = new TempFileSystem();
await fs.init();
workspace.updateWorkspaceFolders(0, 0, { uri: Uri.parse('file:/' + Utils.TempFolder), name: 'BabylonJSEditor' });
// Plugin
context.subscriptions.push(window.createTreeView('babylonjsEditorPlugin', { treeDataProvider: new BabylonJSEditorPlugin() }));
// Dispose
context.subscriptions.push({
dispose: async () => {
Watcher.Dispose();
await fs.clear();
}
});
}
示例2: registerExplorer
function registerExplorer(context: vscode.ExtensionContext): NpmScriptsTreeDataProvider | undefined {
if (vscode.workspace.workspaceFolders) {
let treeDataProvider = new NpmScriptsTreeDataProvider(context);
const view = vscode.window.createTreeView('npm', { treeDataProvider: treeDataProvider, showCollapseAll: true });
context.subscriptions.push(view);
return treeDataProvider;
}
return undefined;
}
示例3: constructor
constructor(context: vscode.ExtensionContext) {
const treeDataProvider = new FileSystemProvider();
this.fileExplorer = vscode.window.createTreeView('fileExplorer', { treeDataProvider });
vscode.commands.registerCommand('fileExplorer.openFile', (resource) => this.openResource(resource));
}
示例4: activate
//.........这里部分代码省略.........
}));
// Handle project changes that might affect SDKs.
context.subscriptions.push(vs.workspace.onDidChangeWorkspaceFolders((f) => {
handleConfigurationChange(sdks);
}));
// Register additional commands.
const analyzerCommands = new AnalyzerCommands(context, analyzer);
const sdkCommands = new SdkCommands(context, workspaceContext, pubGlobal, flutterCapabilities, flutterDaemon && flutterDaemon.deviceManager);
const debugCommands = new DebugCommands(extContext, workspaceContext, analytics, pubGlobal);
// Wire up handling of Hot Reload on Save.
if (workspaceContext.hasAnyFlutterProjects) {
setUpHotReloadOnSave(context, diagnostics, debugCommands);
}
// Register URI handler.
context.subscriptions.push(vs.window.registerUriHandler(new DartUriHandler(flutterCapabilities)));
// Set up commands for Dart editors.
context.subscriptions.push(new EditCommands(context, analyzer));
context.subscriptions.push(new RefactorCommands(context, analyzer));
// Register misc commands.
context.subscriptions.push(new TypeHierarchyCommand(analyzer));
context.subscriptions.push(new GoToSuperCommand(analyzer));
context.subscriptions.push(new LoggingCommands(context.logPath));
context.subscriptions.push(new OpenInOtherEditorCommands(sdks));
context.subscriptions.push(new TestCommands());
// Register our view providers.
const dartPackagesProvider = new DartPackagesProvider();
const packagesTreeView = vs.window.createTreeView("dartPackages", { treeDataProvider: dartPackagesProvider });
context.subscriptions.push(
dartPackagesProvider,
packagesTreeView,
);
context.subscriptions.push(vs.workspace.onDidChangeWorkspaceFolders((f) => {
dartPackagesProvider.refresh();
}));
const testTreeProvider = new TestResultsProvider();
const testTreeView = vs.window.createTreeView("dartTestTree", { treeDataProvider: testTreeProvider });
context.subscriptions.push(
testTreeProvider,
testTreeView,
testTreeProvider.onDidStartTests((node) => {
if (config.openTestViewOnStart)
testTreeView.reveal(node);
}),
testTreeProvider.onFirstFailure((node) => {
if (config.openTestViewOnFailure)
testTreeView.reveal(node);
}),
testTreeView.onDidChangeSelection((e) => {
testTreeProvider.setSelectedNodes(e.selection && e.selection.length === 1 ? e.selection[0] : undefined);
}),
);
if (workspaceContext.hasAnyFlutterProjects && config.previewHotReloadCoverageMarkers) {
context.subscriptions.push(new HotReloadCoverageDecorations(debugCommands));
}
context.subscriptions.push(vs.commands.registerCommand("dart.package.openFile", (filePath) => {
if (!filePath) return;