I think there are missing steps for the vim plugin installation instructions. I installed using vim-plug and added the coc configuration. Coc notified me that rescript language server failed 5 times within 3 minutes.
I tried running the server manually to see what might be wrong and it crashes with
I had to go to the plugin and npm install manually in all the directories. Then it started working.
The plugin also adds around 15 seconds to the vim startup time which is weird. I understand that it’s hard with vim as this can be due to conflicts with some other plugins that I have installed. Just wonder if anybody else noticed this. Removing the plugin brings the startup time back to instant
Oh okay, probably forgot to check in all dependencies…will have a look at it tomorrow!
Regarding startup times I would need more context about your vim setup. Maybe let’s open an issue for that to discuss the details? (note: it shouldn’t add such long startup times, at least that’s something I never observed on my machine)
Not sure if this will fix your 15s issue though, since I believe this is caused by some weird vim plugin combinations, or at least caused by vim-coc… our vim plugin actually does nothing computation intensive, nor does it mess with your global configuration.
what an amazing release!! and thank you so much for the clear communication! excited to see this community mature.going to try this all out on the weekend.
Am I the only one that has issues with the VSCode plugin?
I tried on Windows 10 and MacOS Sierra and in both cases the plugin is crushing immediately.
The moment I open .res file:
undefined:1
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at c:\Users\Mickey\.vscode\extensions\chenglou92.rescript-vscode-1.0.0\server\out\RescriptEditorSupport.js:58:31
at ChildProcess.exithandler (child_process.js:311:5)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
[Info - 20:51:01] Connection to server got closed. Server will restart.
[Error - 20:51:01] Request textDocument/hover failed.
Error: Connection got disposed.
at Object.dispose (c:\Users\Mickey\.vscode\extensions\chenglou92.rescript-vscode-1.0.0\client\node_modules\vscode-jsonrpc\lib\main.js:904:25)
at Object.dispose (c:\Users\Mickey\.vscode\extensions\chenglou92.rescript-vscode-1.0.0\client\node_modules\vscode-languageclient\lib\client.js:74:35)
at LanguageClient.handleConnectionClosed (c:\Users\Mickey\.vscode\extensions\chenglou92.rescript-vscode-1.0.0\client\node_modules\vscode-languageclient\lib\client.js:2309:42)
at LanguageClient.handleConnectionClosed (c:\Users\Mickey\.vscode\extensions\chenglou92.rescript-vscode-1.0.0\client\node_modules\vscode-languageclient\lib\main.js:155:15)
at closeHandler (c:\Users\Mickey\.vscode\extensions\chenglou92.rescript-vscode-1.0.0\client\node_modules\vscode-languageclient\lib\client.js:2296:18)
at CallbackList.invoke (c:\Users\Mickey\.vscode\extensions\chenglou92.rescript-vscode-1.0.0\client\node_modules\vscode-jsonrpc\lib\events.js:62:39)
at Emitter.fire (c:\Users\Mickey\.vscode\extensions\chenglou92.rescript-vscode-1.0.0\client\node_modules\vscode-jsonrpc\lib\events.js:121:36)
at closeHandler (c:\Users\Mickey\.vscode\extensions\chenglou92.rescript-vscode-1.0.0\client\node_modules\vscode-jsonrpc\lib\main.js:240:26)
at CallbackList.invoke (c:\Users\Mickey\.vscode\extensions\chenglou92.rescript-vscode-1.0.0\client\node_modules\vscode-jsonrpc\lib\events.js:62:39)
at Emitter.fire (c:\Users\Mickey\.vscode\extensions\chenglou92.rescript-vscode-1.0.0\client\node_modules\vscode-jsonrpc\lib\events.js:121:36)
at IPCMessageReader.fireClose (c:\Users\Mickey\.vscode\extensions\chenglou92.rescript-vscode-1.0.0\client\node_modules\vscode-jsonrpc\lib\messageReader.js:111:27)
at ChildProcess.<anonymous> (c:\Users\Mickey\.vscode\extensions\chenglou92.rescript-vscode-1.0.0\client\node_modules\vscode-jsonrpc\lib\messageReader.js:213:45)
at ChildProcess.emit (events.js:228:7)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
100% agree with @jsiebern, exceeds expectations! I think this is a huge step in the right direction. We converted our whole codebase to .res already!
Another point that would improve the editor experience (which is a slight regression) is the ability to work not only after save but also while typing.
Sorry for reopening the post, but thanks! That just made my rescript experience faaar better. Maybe this could be in the vscode plugin docs instead of lost in this comment thread? It would be very helpful for beginners coming from ts like me