public void replaceUndefinedSymbolDiagnostics(String fileURI, List<Diagnostic> unresolvedSymbolDiagnostics) {
        Predicate<Diagnostic> undefinedSymbolPredicate = 
            (diagnostic) -> (
                diagnostic.getCode().isRight() 
                && diagnostic.getCode().getRight().equals(DiagnosticCode.UNDEFINED_SYMBOL.ordinal()));

        insertDocumentIfNotExists(fileURI);
        documentDiagnostics.get(fileURI).removeIf(undefinedSymbolPredicate);
        documentDiagnostics.get(fileURI).addAll(unresolvedSymbolDiagnostics.stream().filter(undefinedSymbolPredicate).toList());

        publishDiagnostics(fileURI, List.copyOf(documentDiagnostics.get(fileURI)));
    }
SchemaDiagnosticHandler is a wrapper for publishing diagnostics to the client
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/SchemaDiagnosticsHandler.java