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:
		
							parent
							
								
									7659f2e24b
								
							
						
					
					
						commit
						b50ed5c22c
					
				| @ -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({ | ||||||
|  | |||||||
| @ -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. | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user