public List<Diagnostic> identify(SchemaNode node) {
        List<Diagnostic> ret = new ArrayList<Diagnostic>();

        if (node.isASTInstance(inputElm.class)) {
            return identifyInputType(node);
        }

        if (!node.isSchemaASTInstance(dataType.class)) {
            return ret;
        }

        dataType originalNode = (dataType)node.getOriginalSchemaNode();

        ParsedType parsedType = originalNode.getParsedType();

        if (originalNode.isArrayOldStyle) {
            String nodeText = node.get(0).getText();
            ret.add(new SchemaDiagnostic.Builder()
                    .setRange(node.getRange())
                    .setMessage("Data type syntax '" + nodeText + "[]' is deprecated, use 'array<" + nodeText + ">' instead.")
                    .setSeverity(DiagnosticSeverity.Warning)
                    .setCode(DiagnosticCode.DEPRECATED_ARRAY_SYNTAX)
                    .build());
        }

        if (parsedType == null) {
            // some parsing error has occured
            return ret;
        }

        if (parsedType.getVariant() == Variant.ANN_REFERENCE) {
            if (!isInsideAnnotationBody(node)) {
                ret.add(new SchemaDiagnostic.Builder()
                        .setRange( node.getRange())
                        .setMessage( "annotationreference should only be used inside an annotation")
                        .setSeverity( DiagnosticSeverity.Error)
                        .setCode(DiagnosticCode.ANNOTATION_REFERENCE_OUTSIDE_ANNOTATION)
                        .build() );
            }
        }

        if (parsedType.getVariant() == Variant.MAP) {
            Node keyTypeNode = node.get(0).get(2);

            if (keyTypeNode != null && keyTypeNode.isASTInstance(dataType.class)) {
                ParsedType keyParsedType = ((dataType)keyTypeNode.getSchemaNode().getOriginalSchemaNode()).getParsedType();
                if (keyParsedType.getVariant() != Variant.BUILTIN) {
                    // TODO: quickfix
                    ret.add(new SchemaDiagnostic.Builder()
                            .setRange( keyTypeNode.getRange())
                            .setMessage( "Map key type must be a primitive type")
                            .setSeverity( DiagnosticSeverity.Error)
                            .build() );
                }
            }
        }

        if (parsedType.getVariant() != Variant.UNKNOWN) {
            return ret;
        }

        Optional<Symbol> scope = CSTUtils.findScope(node);
        if (scope.isPresent()) {
            node.setSymbol(SymbolType.TYPE_UNKNOWN, context.fileURI(), scope.get());
        } else {
            node.setSymbol(SymbolType.TYPE_UNKNOWN, context.fileURI());
        }

        this.context.addUnresolvedTypeNode(node);
        return ret;
    }
IdentifyType identifies types in the schema document
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/schemadocument/parser/schema/IdentifyType.java