@Override
	public ArrayList<Diagnostic> identify(SchemaNode node) {
        ArrayList<Diagnostic> ret = new ArrayList<>();
        if (!node.isSchemaASTInstance(documentElm.class))return ret;

        if (node.size() < 2 || !node.get(1).getSchemaNode().isSchemaASTInstance(identifierStr.class))return ret;

        Range identifierRange = node.get(1).getRange();
        String documentName = node.get(1).getText();
        Optional<Symbol> schemaSymbol = context.schemaIndex().getSchemaDefinition(documentName);
        if (schemaSymbol.isEmpty() || !schemaSymbol.get().getShortIdentifier().equals(documentName)) {
            // TODO: Quickfix
            ret.add(new SchemaDiagnostic.Builder()
                .setRange(identifierRange)
                .setMessage("Invalid document name \"" + documentName + "\". The document name must match the containing schema's name.")
                .setSeverity(DiagnosticSeverity.Error)
                .setCode(DiagnosticCode.DOCUMENT_NAME_SAME_AS_SCHEMA)
                .build());
        }

        return ret;
	}
IdentifyNamedDocument verifies that a document has the same name as the schema the document is part of.

Should run after symbol definition identifiers
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/schemadocument/parser/schema/IdentifyNamedDocument.java