Org Babel is really nice, but it doesn't really solve the problem, rather it sidesteps it my giving you the option to edit a block of code in a dedicated buffer. I don't know how well that works with LSP (I don't use LSP) but it does allow you to make full use of SLIME.
Re:Literate Programming: Articles
by ParetoOptimal on Wednesday May 31, 2023 @08:09PM
(#36146164)
lsp-mode does support tooling in source code blocks without opening it in a dedicated buffer by creating a virtual one backing it.
See https://emacs-lsp.github.io/lsp-mode/manual-language-docs/ls...
I’ve heard that org-babel [https://orgmode.org/worg/org-contrib/babel/intro.html] works pretty well for this, though I’ve never used it myself.