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 080a8bfd43
commit 37727ce898
2 changed files with 1 additions and 4 deletions

View File

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

View File

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