Skip to content

Commit

Permalink
Create a setting to suppress readme tabs (#4292)
Browse files Browse the repository at this point in the history
* Create a setting to suppress readme tabs

* Erase double quote

* ;
  • Loading branch information
nturinski authored Sep 20, 2024
1 parent 64e387a commit 899ba17
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
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');
}
}

0 comments on commit 899ba17

Please sign in to comment.