import { XMLElement } from "@xml-tools/ast" ; import { resolveXMLNS , getUI5ClassByXMLElement , } from "@ui5-language-assistant/logic-utils" ; import { UI5SemanticModel } from "@ui5-language-assistant/semantic-model-types" ; import { SVG_NS , TEMPLATING_NS , XHTML_NS } from "./special-namespaces" ; export function isPossibleCustomClass ( xmlElement ) { return ( /^[A-Z]/ . test ( xmlElement . name ) && ! isCommonExternalNamespace ( xmlElement ) ) ; } export function isKnownUI5Class ( xmlElement , model ) { const ui5Class = getUI5ClassByXMLElement ( xmlElement , model ) ; return ui5Class !== undefined ; } const allowedListedNamespaces = { [ SVG_NS ] : true , [ TEMPLATING_NS ] : true , [ XHTML_NS ] : true , } ; Object . freeze ( allowedListedNamespaces ) ; function isCommonExternalNamespace ( xmlElement ) { const parentResolvedNamespace = resolveXMLNS ( xmlElement ) ; if ( parentResolvedNamespace === undefined ) { return false ; } return allowedListedNamespaces [ parentResolvedNamespace ] ; }