当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript window.createTreeView方法代码示例

本文整理汇总了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();
        }
    });
}
开发者ID:BabylonJS,项目名称:Editor,代码行数:27,代码来源:extension.ts

示例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;
}
开发者ID:PKRoma,项目名称:vscode,代码行数:9,代码来源:main.ts

示例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));
	}
开发者ID:voodoos,项目名称:vscode-extension-samples,代码行数:5,代码来源:fileExplorer.ts

示例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;
开发者ID:DanTup,项目名称:Dart-Code,代码行数:66,代码来源:extension.ts


注:本文中的vscode.window.createTreeView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。