-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add instructions for LSP setup #3
Comments
As one of the dozen people using sublime with rescript, I thought I'd share my findings with getting LSP to work with ST4. First of all you need to install the sublime-lsp package and rescript-sublime (this package). Next step is to find the rescript language server. It is currently part of the rescript-vscode package. You can either follow the instructions here and place it somewhere on your computer (remember the path). Or if you already have vscode and rescript-vscode installed, you can do like me and just use the path to the extension directly: Downside with the latter approach is that it will stop working if the vscode extension is updated. Upside is (also) that it will stop working if the vscode extension is updated, since you would otherwise need to manually check for updates. Ideally I'd like to see the language server become a separate package (with official support for sublime), but I understand why that is not a priority. Once you have the path you need to open LSP.sublime-settings and add the client (replace PATH/TO/ with actual path): {
"clients": {
"rescript": {
"command": [
"node",
"PATH/TO/server.js",
"--stdio"
],
"enabled": true,
"selector": "source.res | source.resi",
}
}
} Now restart sublime and make sure that the compiler is also running ( You may notice that the syntax highlighting is not working. To get it working you need to open Preferences.sublime-settings and add the following configuration: {
"mdpopups.sublime_user_lang_map": {
"rescript": [["rescript"], ["ReScript/rescript-sublime/ReScript"]],
}
} That should be all! I hope this can be of some use to the (probably few) people using sublime with rescript. I didn't want to make a PR to the sublime-LSP repo, since I don't feel like this package is quite ready for it yet (the rescript language server needs to officially support sublime and it should be bundled with the sublime package IMHO). |
Probably might be worth submitting a PR to the sublime-LSP repo, which apparently offers proper docs for each configurable language server.
(Example for Reason)
The text was updated successfully, but these errors were encountered: