Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,11 @@
"type": "boolean",
"description": "%azureFunctions.showFlexEventGridWarning%",
"default": true
},
"azureFunctions.showMarkdownPreview": {
"type": "boolean",
"description": "%azureFunctions.showMarkdownPreview%",
"default": true
}
}
}
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"azureFunctions.viewCommitInGitHub": "View Commit in GitHub",
"azureFunctions.viewDeploymentLogs": "View Deployment Logs",
"azureFunctions.viewProperties": "View Properties",
"azureFunctions.showMarkdownPreview": "Enables showing the markdown preview after creating a new PythonV2 template",
"azureFunctions.eventGrid.sendMockRequest": "Save and execute...",
"azureFunctions.walkthrough.functionsStart.create.description": "If you're just getting started, you will need to create an Azure Functions project. Follow along with the [Visual Studio Code developer guide](https://aka.ms/functions-getstarted-vscode) for step-by-step instructions.\n[Create New Project](command:azureFunctions.createNewProject)",
"azureFunctions.walkthrough.functionsStart.create.title": "Create a new Azure Functions project",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { nonNullProp } from "@microsoft/vscode-azext-utils";
import { assertTemplateIsV2 } from "../../../utils/templateVersionUtils";
import { showMarkdownPreviewContent } from "../../../utils/textUtils";
import { getWorkspaceSetting } from "../../../vsCodeConfig/settings";
import { type FunctionV2WizardContext } from "../IFunctionWizardContext";
import { ActionSchemaStepBase } from "./ActionSchemaStepBase";

Expand All @@ -17,4 +18,8 @@ export class ShowMarkdownPreviewExecuteStep<T extends FunctionV2WizardContext> e
const content = context.functionTemplate.files[filename] ?? '';
await showMarkdownPreviewContent(content, filename, /* openToSide: */ true);
}

public shouldExecute(_context: T): boolean {
return !!getWorkspaceSetting('showMarkdownPreview');
}
}