message: localize()

in language-service/src/services/yamlValidation.ts [69:134]


							message: localize('documentFormatError', 'Invalid YAML structure')
						}]);
					}
				}
			}

			return this.promise.resolve([{
				severity: DiagnosticSeverity.Error,
				range: {
					start: {
						line: 0,
						character: 0
					},
					end: textDocument.positionAt(textDocument.getText().length)
				},
				message: localize('multiDocumentError', 'Only single-document files are supported')
			}]);
		}

		const translateSeverity = (problemSeverity: ProblemSeverity): DiagnosticSeverity => {
			if (problemSeverity === ProblemSeverity.Error) {
				return DiagnosticSeverity.Error;
			 }
			 if (problemSeverity == ProblemSeverity.Warning) {
				 return DiagnosticSeverity.Warning;
			 }

			 return DiagnosticSeverity.Hint;
		};

		return this.jsonSchemaService.getSchemaForResource(textDocument.uri).then(function (schema) {
			var diagnostics: Diagnostic[] = [];

			let jsonDocument: SingleYAMLDocument = yamlDocument.documents[0];

			jsonDocument.errors.forEach(err => {
				diagnostics.push({
					severity: DiagnosticSeverity.Error,
					range: {
						start: textDocument.positionAt(err.start),
						end: textDocument.positionAt(err.end)
					},
					message: err.getMessage()
				});
			});

			jsonDocument.warnings.forEach(warn => {
				diagnostics.push({
					severity: DiagnosticSeverity.Warning,
					range: {
						start: textDocument.positionAt(warn.start),
						end: textDocument.positionAt(warn.end)
					},
					message: warn.getMessage()
				});
			});

			if (schema) {
				var added: {[key:string]: boolean} = {};
				const problems: IProblem[] = jsonDocument.getValidationProblems(schema.schema);
				problems.forEach(function (problem: IProblem, index: number) {
					const message: string = problem.getMessage();
					const signature: string = '' + problem.location.start + ' ' + problem.location.end + ' ' + message
					if (!added[signature]) {
						added[signature] = true;
						diagnostics.push({