Make LSP in Neovim work nicely with PPX's?

I have a basic neovim setup (very light on plugins), and I have ocamlformat and LSP for ocaml configured. The setup works pretty well, but when I started using a ppx (namely PGOcaml), I would get errors saying “something ocamllsp unsupported” and errors that do not make sense. These errors do not show up when I run “dune build”, and it seems it is just that the lsp does not recognize the ppx syntax.

Is there a way to make LSP ignore these issues when it comes to ppx?

here is my code example with the errors coming up at the bottom:

Hi @espioka,

I think this might be due the final % before your ] – it is not needed. Line 9 should be:

let query title = [%pgsql dbh "insert into tasks..."] in