I think the replace-ranges highlighter already provides this functionality, with exception that the content displayed that way can not be interacted with using cursors.
Perhaps virtual lines (and some sort of virtual anti-lines) provides a way to implement the long unresolved issue of code folding in kakoune.
I realised that with lsp-inlay-diagnostic-enable window I can get the below effect which is perhaps closer to what I’m looking for but still not as nice as that Neovim’s virtual lines.
I think think this should be completely possible with replace ranges. I don’t think adding lines creates any issues and it would basically just require that LSP added a few newlines to inlay diagnostics.
And regarding folding I did get it to work with replace ranges. It’s not perfect but it’s something and I’m sure it could be improved