-
Notifications
You must be signed in to change notification settings - Fork 184
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
Rust: Format selection disabled in context menu but Format document is not #1414
Comments
This should be fixed for the ST3 version: #372 Please try the following: Set Then, look for a request from your rls with the method |
I don't see any other log line that registers documentRangeFormattingProvider, so, apparently rls doesn't register itself as that kind of provider. |
You may have to play around with settings: https://github.com/rust-lang/rls#configuration The server settings mentioned on that page map to this kind of structure in this client:
Restart ST3 for every such change. |
I applied these settings: "settings":
{
"LSP":
{
"rls":
{
"enabled": true,
"settings": {
"unstable_features": true
}
}
}
} I couldn't find a specific option on the RLS project page for range formatting though, and the remark for
Restarting ST3 gives this line relating to capabilities:
I actually tried to install RLS from the unstable channel, but rustup gave an error (which I did not copy at the time) which more or less said "not every package is available in unstable every day." |
I don't know the exact kind of setting that would enable formatting. Perhaps @ehuss can be of help. You may also want to look into rust-analyzer as an alternative as that project has a lot of activity. |
Exactly the same symptom with
|
From |
I will close this as this seems to be an issue of language servers. You should join the discussion at rust-lang/rust-analyzer#5849. Formatting the current selection is fully implemented in this client and works very well. |
Sublime Text 3 (Build 3211)
Rust enhanced: v2.22.0
RLS: rls 1.41.0 (9bfb47a 2020-10-05)
LSP: v0.13.1
OS: Ubuntu 20.04
I have LSP and Rust Enhanced installed via Package Control, and the stable and beta releases of RLS installed via Rustup. I do not have Cargo etc. on my system path, but I have added:
...to my LSP user settings.
Expected behavior
Both Format document and Format selection should be enabled in the context menu.
Actual behavior
Format document is enabled. Format selection is not.
The fact that Format document is enabled and works makes me think that LSP and RLS are communicating fine, but there's a capability missing or something like that.
Here's some console messages (I removed what I thought was from unrelated plugins, let me know if you want that too):
I honestly don't know what
Unable to open /home/jason/Code/config-st3/Packages/LSP/LSP.sublime-settings
is doing there, since LSP works fine.Unable to open /home/jason/Code/config-st3/Packages/Rust Enhanced/RustEnhanced.sublime-settings
is also a bit weird, since Rust Enhanced seems to use my settings for eg. appearances, Cargo path.The text was updated successfully, but these errors were encountered: