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

        ParseExceptionSource parseException = node.getParseExceptionSource();
        
        if (parseException != null) {
            TokenSource tokenSource = node.getTokenSource();
            Range range = CSTUtils.getRangeFromOffsets(tokenSource, parseException.beginOffset, parseException.endOffset);
            String message = getParseExceptionMessage(parseException.parseException);
            ret.add(new SchemaDiagnostic.Builder()
                .setRange(range)
                .setMessage(message)
                .setSeverity(DiagnosticSeverity.Error)
                .build());
        }

        IllegalArgumentException illegalArgumentException = node.getIllegalArgumentException();

        if (illegalArgumentException != null) {
            ret.add(new SchemaDiagnostic.Builder()
                .setRange(node.getRange())
                .setMessage(illegalArgumentException.getMessage())
                .setSeverity(DiagnosticSeverity.Error)
                .build());
        }


        if (
            parseException == null &&
            illegalArgumentException == null
        ) {
            ret.addAll(pureDirtyNodeIdentifier.identify(node));
        }

        return ret;
    }
Mark all dirty nodes as Syntax error
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/schemadocument/parser/schema/IdentifyDirtySchemaNodes.java