import { UI5SemanticModel } from "@ui5-language-assistant/semantic-model-types" ; import { GENERATED_LIBRARY } from "./api" ; import { getParentFqn , newMap , forEachSymbol , findSymbol } from "./utils" ; export function generateMissingSymbols ( model , strict ) { addImplicitNamespacesForModel ( model ) ; } function addImplicitNamespacesForModel ( model ) { forEachSymbol ( model , ( value , key ) => { addImplicitParentNamespaces ( model , key , value . name ) ; } ) ; } function addImplicitParentNamespaces ( model , fqn , name ) { const parentFqn = getParentFqn ( fqn , name ) ; if ( parentFqn !== undefined && findSymbol ( model , parentFqn ) === undefined ) { const parentName = parentFqn . substring ( parentFqn . lastIndexOf ( "." ) + 1 ) ; model . namespaces [ parentFqn ] = { kind : "UI5Namespace" , name : parentName , fields : [ ] , visibility : "public" , events : [ ] , methods : [ ] , parent : undefined , library : GENERATED_LIBRARY , namespaces : newMap ( ) , classes : newMap ( ) , description : undefined , since : undefined , deprecatedInfo : undefined , experimentalInfo : undefined , } ; if ( parentFqn !== parentName ) { addImplicitParentNamespaces ( model , parentFqn , parentName ) ; } } }