Skip to content

Commit

Permalink
Merge pull request #906 from redhat-developer/refactor-yaml-recommend…
Browse files Browse the repository at this point in the history
…ation-flag

renamed yaml.extension.recommendations
  • Loading branch information
msivasubramaniaan committed Mar 16, 2023
2 parents 0b979a2 + 84b5bb9 commit 907dd00
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -65,6 +65,7 @@ The following settings are supported:
- `yaml.style.flowMapping` : Forbids flow style mappings if set to `forbid`
- `yaml.style.flowSequence` : Forbids flow style sequences if set to `forbid`
- `yaml.keyOrdering` : Enforces alphabetical ordering of keys in mappings when set to `true`. Default is `false`
- `yaml.extension.recommendations` : Enable extension recommendations for YAML files. Default is `true`

## Adding custom tags

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -219,7 +219,7 @@
"default": false,
"description": "Enforces alphabetical ordering of keys in mappings when set to true"
},
"yaml.recommendations.show": {
"yaml.extension.recommendations": {
"type": "boolean",
"default": "true",
"description": "Suggest additional extensions based on YAML usage."
Expand Down
4 changes: 2 additions & 2 deletions src/recommendation/openShiftToolkit.ts
Expand Up @@ -13,7 +13,7 @@ import { IHandler } from './handler';
const EXTENSION_NAME = 'redhat.vscode-openshift-connector';
const GH_ORG_URL = `https://github.com/redhat-developer/vscode-openshift-tools`;
const RECOMMENDATION_MESSAGE = `The workspace has a devfile.yaml. Install [OpenShift Toolkit](${GH_ORG_URL}) extension for assistance with deploying to a cluster?`;
const YAML_RECOMMENDATIONS_SHOW = 'yaml.recommendations.show';
const YAML_EXTENSION_RECOMMENDATIONS = 'yaml.extension.recommendations';

function isDevfileYAML(uri: vscode.Uri): boolean {
try {
Expand All @@ -28,7 +28,7 @@ function isDevfileYAML(uri: vscode.Uri): boolean {
}

export function initializeRecommendation(context: vscode.ExtensionContext, handler: IHandler): void {
const show = vscode.workspace.getConfiguration().get(YAML_RECOMMENDATIONS_SHOW);
const show = vscode.workspace.getConfiguration().get(YAML_EXTENSION_RECOMMENDATIONS);
if (!show) {
return;
}
Expand Down

0 comments on commit 907dd00

Please sign in to comment.