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):
rescriptls = {
cmd = { 'rescript-language-server', '--stdio' },
init_options = {
extensionConfiguration = {
askToStartBuild = false,
incrementalTypechecking = {
enabled = true,
},
},
},
capabilities = {
workspace = {
didChangeWatchedFiles = {
dynamicRegistration = true,
},
},
},
}