fix(language-service): Make metadata in Declaration non-optional (#34936)

The `metadata` field in `Declaration` should not be optional.

PR Close #34936
This commit is contained in:
Keen Yee Liau 2020-01-23 12:59:57 -08:00 committed by Andrew Kushnir
parent 7659f2e24b
commit b50ed5c22c
2 changed files with 1 additions and 4 deletions

View File

@ -96,9 +96,6 @@ export function getDeclarationDiagnostics(
span: error.span, span: error.span,
}); });
} }
if (!metadata) {
continue; // declaration is not an Angular directive
}
if (metadata.isComponent) { if (metadata.isComponent) {
if (!modules.ngModuleByPipeOrDirective.has(declaration.type)) { if (!modules.ngModuleByPipeOrDirective.has(declaration.type)) {
results.push({ results.push({

View File

@ -124,7 +124,7 @@ export interface Declaration {
/** /**
* Reference to the compiler directive metadata for the declaration. * Reference to the compiler directive metadata for the declaration.
*/ */
readonly metadata?: CompileDirectiveMetadata; readonly metadata: CompileDirectiveMetadata;
/** /**
* Error reported trying to get the metadata. * Error reported trying to get the metadata.