Allow usage of custom @rescript/language-server
In more recent versions of ReScript, the rescript-editor-analysis is shipped with your local compiler.
The version the bundled LSP Server is invoking is no longer compatible with newer compiled code.
Is there an option to use a custom ReScript LSP server via configuration? I would like to install a version I know is compatible and use that one instead of the one bundled with the zed plugin.
(For anyone reading this, I was able to just update the LSP server by running npm i @rescript/[email protected] in /Users/<my-user-name>/Library/Application Support/Zed/extensions/work/rescript
Worth noting that recent versions of the language server (like the one updated to here by @nojaf ) should handle ReScript versions transparently. So, recent versions should be compatible with pre v12 as well as v12+ versions.
So, if the main version of the LSP is upgraded centrally here, it should work for all ReScript versions.
@zth Please explain. I don't understand. I see in Zed I have version v.0.2.0 of the extension. In the extensions folder I see it uses language server 1.62.0. What should I do to always ensure I have the latest working stuff? Do we need to wait for the extension to get updated? Should I do the step suggested by @nojaf ?
Go to symbol doesn't work for me. Does it work for you?
I updated the LSP. Still get this error when starting Zed. Weird. It is complaining about a file that does not exist. It used to exist but I deleted it. When I do find . -name "Experiment.res nothing is found. A project-wide search in VS Code for "Experiment" doesn't find it. I deleted the lib bs folder too. Maybe Zed editor is caching something?
ReScript tooling: Internal error. Something broke. Here's the error message that you can report if you want:
Error: Command failed: /Users/justinmagaram/Library/Application Support/Zed/extensions/work/rescript/node_modules/@rescript/language-server/analysis_binaries/darwinarm64/rescript-editor-analysis.exe codeAction /Users/justinmagaram/Source/hot/src/Experiment.res 0 0 0 0 /var/folders/nh/4c3_nmmd3fs41j1lb6vzmvth0000gn/T/rescript_format_file_48783_0.res
Fatal error: exception Sys_error("/Users/justinmagaram/Source/hot/src/Experiment.res: No such file or directory")
(this message will only be reported once every 15 minutes)
Zed helped me fix the ReScript tooling error. I recreated the phantom files it was complaining about and then deleted them. But there's still a problem with using the language server from within Zed. It will do auto complete and formatting and find references, but it will not show symbols. Go to Symbol and the outline panel are empty. I've tried with the latest language server and no improvement. Any ideas?