mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 04:09:28 +00:00
Merge pull request #163498 from DanielRosenwasser/iconsForWalkthroughs
Allow walkthroughs to specify icons.
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 5.8 KiB |
@@ -1570,6 +1570,7 @@
|
||||
{
|
||||
"id": "nodejsWelcome",
|
||||
"title": "%walkthroughs.nodejsWelcome.title%",
|
||||
"icon": "media/nodejsWalkthroughIcon.png",
|
||||
"description": "%walkthroughs.nodejsWelcome.description%",
|
||||
"when": "false",
|
||||
"steps": [
|
||||
|
||||
@@ -137,6 +137,7 @@ export interface IWalkthroughStep {
|
||||
export interface IWalkthrough {
|
||||
readonly id: string;
|
||||
readonly title: string;
|
||||
readonly icon?: string;
|
||||
readonly description: string;
|
||||
readonly steps: IWalkthroughStep[];
|
||||
readonly featuredFor: string[] | undefined;
|
||||
|
||||
@@ -27,6 +27,10 @@ export const walkthroughsExtensionPoint = ExtensionsRegistry.registerExtensionPo
|
||||
type: 'string',
|
||||
description: localize('walkthroughs.title', "Title of walkthrough.")
|
||||
},
|
||||
icon: {
|
||||
type: 'string',
|
||||
description: localize('walkthroughs.icon', "Relative path to the icon of the walkthrough. The path is relative to the extension location. If not specified, the icon defaults to the extension icon if available."),
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
description: localize('walkthroughs.description', "Description of walkthrough.")
|
||||
|
||||
@@ -389,6 +389,7 @@ export class WalkthroughsService extends Disposable implements IWalkthroughsServ
|
||||
isFeatured = await this.instantiationService.invokeFunction(a => checkGlobFileExists(a, folders, walkthrough.featuredFor!, token.token));
|
||||
}
|
||||
|
||||
const iconStr = walkthrough.icon ?? extension.icon;
|
||||
const walkthoughDescriptor: IWalkthrough = {
|
||||
description: walkthrough.description,
|
||||
title: walkthrough.title,
|
||||
@@ -399,8 +400,8 @@ export class WalkthroughsService extends Disposable implements IWalkthroughsServ
|
||||
steps,
|
||||
icon: {
|
||||
type: 'image',
|
||||
path: extension.icon
|
||||
? FileAccess.asBrowserUri(joinPath(extension.extensionLocation, extension.icon)).toString(true)
|
||||
path: iconStr
|
||||
? FileAccess.asBrowserUri(joinPath(extension.extensionLocation, iconStr)).toString(true)
|
||||
: DefaultIconPath
|
||||
},
|
||||
when: ContextKeyExpr.deserialize(override ?? walkthrough.when) ?? ContextKeyExpr.true(),
|
||||
|
||||
Reference in New Issue
Block a user