private void handleDataTypeDefinition(SchemaNode node, List<Diagnostic> diagnostics) {
        if (node.getParent() == null)return;

        if (node.getParent().isASTInstance(mapDataType.class)) {

            Optional<Symbol> scope = findMapScope(node.getParent());

            if (!scope.isPresent()) return;

            if (node.getParent().indexOf(node) == 2) {
                // Map key type
                node.setSymbol(SymbolType.MAP_KEY, context.fileURI(), scope.get(), "key");
                node.setSymbolStatus(SymbolStatus.DEFINITION);
                context.schemaIndex().insertSymbolDefinition(node.getSymbol());
            } else if (node.getParent().indexOf(node) == 4) {
                // Map value type
                // Should only define a new type if this guy is not a reference to something else
                dataType dataTypeNode = (dataType)node.getOriginalSchemaNode();
                if (dataTypeNode.getParsedType().getVariant() == Variant.UNKNOWN) return;

                node.setSymbol(SymbolType.MAP_VALUE, context.fileURI(), scope.get(), "value");
                node.setSymbolStatus(SymbolStatus.DEFINITION);
                context.schemaIndex().insertSymbolDefinition(node.getSymbol());
            }
        }

        if (node.isASTInstance(tensorTypeElm.class)) {
            Optional<Symbol> scope = CSTUtils.findScope(node);

            if (!scope.isPresent()) return;

            try {
                TensorType tensorType = TensorTypeParser.fromSpec(node.getText());

                node.setSymbol(SymbolType.TENSOR, context.fileURI(), scope.get());
                node.setSymbolStatus(SymbolStatus.DEFINITION);
                context.schemaIndex().insertSymbolDefinition(node.getSymbol());

                for (var dimension : tensorType.dimensions()) {
                    SymbolType type = (dimension instanceof MappedDimension) ? SymbolType.TENSOR_DIMENSION_MAPPED : SymbolType.TENSOR_DIMENSION_INDEXED;
                    Symbol dimensionSymbol = new Symbol(node, type, context.fileURI(), node.getSymbol(), dimension.name());
                    dimensionSymbol.setStatus(SymbolStatus.DEFINITION);
                    context.schemaIndex().insertSymbolDefinition(dimensionSymbol);
                }
            } catch(Exception e) {
                // ignore
            }
        }
    }
Some datatypes need to define symbols.
Currently only map, which defines MAP_KEY and MAP_VALUE symbols at the dataType nodes inside the map
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/schemadocument/parser/schema/IdentifySymbolDefinition.java