Skip to content
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

Configuration examples for VS Code #56

Open
tobyhede opened this issue Dec 25, 2023 · 5 comments
Open

Configuration examples for VS Code #56

tobyhede opened this issue Dec 25, 2023 · 5 comments

Comments

@tobyhede
Copy link

There are no details on how to set this up for VS Code.

@AOx0
Copy link

AOx0 commented Dec 26, 2023

I tried to set it up, which was relatively easy, but get the error: "Unsupported position encoding (utf-8) received from server Rust Analyzer Language Server". I think this is related to lsp defaulting to utf-16, which can be tracked at vscode-languageserver-node/#1224.

Whatever, the configuration per se is just to add in VSCode's settings.json:

{
    "rust-analyzer.server.path": "/path/to/ra-multiplex",
    ...
}

I don't know If there is a way in the current implementation to specify the lsp to use utf-16 instead of utf-8.

@AOx0
Copy link

AOx0 commented Dec 26, 2023

Nvm got it working, but sometimes it still gives the utf-8 error, but it eventually goes away and can use it without problem. So just adding the server path to the settings.json should do it.

Screenshot 2023-12-26 at 4 41 37 a m

@pr2502
Copy link
Owner

pr2502 commented Jan 2, 2024

vscode already uses only a single rust-analyzer instance per window, adding ra-multiplex into the loop is probably going to cause you more trouble than it's worth, with how heavy the editor alone is you probably don't want to have multiple windows with the same project open.

@tobyhede
Copy link
Author

tobyhede commented Jan 2, 2024

@pr2502 That's good advice, thanks.

@RReverser
Copy link

adding ra-multiplex into the loop is probably going to cause you more trouble than it's worth

FWIW for me it's still useful because I tend to keep my laptop on but open / close different projects throughout the day depending on what I'm working on.

Rust Analyzer takes forever (up to ~2 min) to start each time I open VSCode on some of the larger projects, so keeping ra-multiplex always in background is still very much worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants