Function createDiagnosticContext