Skip to content

Commit

Permalink
fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ytausch committed Jan 21, 2025
1 parent 6be8db3 commit 49f1ab4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/languageservice/services/yamlHover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class YAMLHover {
if (s.schema.anyOf && isAllSchemasMatched(node, matchingSchemas, s.schema)) {
//if append title and description of all matched schemas on hover
title = '';
markdownDescription = s.schema.description ? (s.schema.description + '\n') : '';
markdownDescription = s.schema.description ? s.schema.description + '\n' : '';
s.schema.anyOf.forEach((childSchema: JSONSchema, index: number) => {
title += childSchema.title || s.schema.closestTitle || '';
markdownDescription += childSchema.markdownDescription || this.toMarkdown(childSchema.description) || '';
Expand Down
16 changes: 8 additions & 8 deletions test/hover.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -772,16 +772,16 @@ Source: [${SCHEMA_ID}](file:///${SCHEMA_ID})`
properties: {
optionalZipFile: {
title: 'ZIP file',
anyOf: [{ type: "string", pattern: "\\.zip$" }, { type: "null" }],
anyOf: [{ type: 'string', pattern: '\\.zip$' }, { type: 'null' }],
default: null,
description: "Optional ZIP file path.",
description: 'Optional ZIP file path.',
},
},
required: ['optionalZipFile'],
additionalProperties: false,
});
let content = 'optionalZipF|i|le:';
let result = await parseSetup(content);
const content = 'optionalZipF|i|le:';
const result = await parseSetup(content);

assert.strictEqual(MarkupContent.is(result.contents), true);
assert.strictEqual(
Expand All @@ -806,7 +806,7 @@ Source: [${SCHEMA_ID}](file:///${SCHEMA_ID})`
$ref: '#/definitions/SecondChoice',
},
],
description: "The parent description."
description: 'The parent description.',
},
},
required: ['child'],
Expand Down Expand Up @@ -851,15 +851,15 @@ Source: [${SCHEMA_ID}](file:///${SCHEMA_ID})`
},
});

let content = 'ch|i|ld:';
let result = await parseSetup(content);
const content = 'ch|i|ld:';
const result = await parseSetup(content);
assert.strictEqual(MarkupContent.is(result.contents), true);
assert.strictEqual(
(result.contents as MarkupContent).value,
`#### FirstChoice || SecondChoice\n\nThe parent description.\nThe first choice || The second choice\n\nSource: [${SCHEMA_ID}](file:///${SCHEMA_ID})`
);
expect(telemetry.messages).to.be.empty;
})
});
});

describe('Bug fixes', () => {
Expand Down

0 comments on commit 49f1ab4

Please sign in to comment.