From 899ba1747b43aeeb22fba7271df2c064952f18cb Mon Sep 17 00:00:00 2001 From: Nathan Date: Fri, 20 Sep 2024 13:54:51 -0700 Subject: [PATCH] Create a setting to suppress readme tabs (#4292) * Create a setting to suppress readme tabs * Erase double quote * ; --- package.json | 5 +++++ package.nls.json | 1 + .../actionStepsV2/ShowMarkdownPreviewExecuteStep.ts | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/package.json b/package.json index a66bc215e..23c7746ef 100644 --- a/package.json +++ b/package.json @@ -1107,6 +1107,11 @@ "type": "boolean", "description": "%azureFunctions.showFlexEventGridWarning%", "default": true + }, + "azureFunctions.showMarkdownPreview": { + "type": "boolean", + "description": "%azureFunctions.showMarkdownPreview%", + "default": true } } } diff --git a/package.nls.json b/package.nls.json index 185ecbddb..d8d5b78a0 100644 --- a/package.nls.json +++ b/package.nls.json @@ -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", diff --git a/src/commands/createFunction/actionStepsV2/ShowMarkdownPreviewExecuteStep.ts b/src/commands/createFunction/actionStepsV2/ShowMarkdownPreviewExecuteStep.ts index 05f547ab3..35989dba0 100644 --- a/src/commands/createFunction/actionStepsV2/ShowMarkdownPreviewExecuteStep.ts +++ b/src/commands/createFunction/actionStepsV2/ShowMarkdownPreviewExecuteStep.ts @@ -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"; @@ -17,4 +18,8 @@ export class ShowMarkdownPreviewExecuteStep e const content = context.functionTemplate.files[filename] ?? ''; await showMarkdownPreviewContent(content, filename, /* openToSide: */ true); } + + public shouldExecute(_context: T): boolean { + return !!getWorkspaceSetting('showMarkdownPreview'); + } }