Now when a file has an error (a type error), it will get reported as expected.
So I update my code to fix the error. But now the error is still reported, and it will never go until I restart the editor.
In other words the errors are not cleared even after being fixed.
Also, it seems to not report more than one error per file. Only the first type error is reported.
I installed it via Mason (rescriptls), and below is the exact config I put in lspconfig for rescript:
@dkirchhof thanks for your help. Unfortunately the issue is still here after I enabled dynamicRegistration. I still need to restart the LSP to see things changing.
I also noticed that it’s not working well if I don’t start rescript compiler in watch mode rescript -w. It seems that the lsp used the build directory to detect issue rather than the code itself.
Your assumption is right, the language server doesn’t inspect the code, it uses the compiler output to check for errors and warnings.
So you have to start neovim in the root directory (where the rescript.json file is located) and the compiler in watch mode (rescript watch in the newest alpha / beta versions).
Your config looks similar to mine. Don’t know, if the settings field is correct?!
Here is my config (language server 1.66.0, installed as global node module):
@dkirchhof thanks for sharing your configuration. It’s still not working for me. So there is definitely something off. I’ll have to upgrade my neovim and lazyvim to latest, but that’s a breaking upgrade. I’ll do that later when I have enough time to migrate everything.
I’ll keep this thread up my sleeve and let you whether it worked.