Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicated {0} placeholders in new snippetsService messages #34196

Merged
merged 1 commit into from
Sep 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,19 @@ namespace schema {

export function isValidSnippet(extension: IExtensionPointUser<ISnippetsExtensionPoint[]>, snippet: ISnippetsExtensionPoint, modeService: IModeService): boolean {
if (!snippet.language || (typeof snippet.language !== 'string') || !modeService.isRegisteredMode(snippet.language)) {
extension.collector.error(localize('invalid.language', "Unknown language in `contributes.{0}.language`. Provided value: {0}", String(snippet.language)));
extension.collector.error(localize(
'invalid.language',
"Unknown language in `contributes.{0}.language`. Provided value: {1}",
extension.description.name, String(snippet.language)
));
return false;

} else if (!snippet.path || (typeof snippet.path !== 'string')) {
extension.collector.error(localize('invalid.path.0', "Expected string in `contributes.{0}.path`. Provided value: {0}", String(snippet.path)));
extension.collector.error(localize(
'invalid.path.0',
"Expected string in `contributes.{0}.path`. Provided value: {1}",
extension.description.name, String(snippet.path)
));
return false;

} else {
Expand Down