-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
VS Code Flatpak Support #2873
Comments
I solved this by telling flatpak to let the PATH env var to include |
Hm, looks like this ideally should be some build-in API in the VS Code, similar to how file system is. But I guess there isn't, and we indeed should do this ourselves :-( Also, I cannot help but note that there's a much better solution for reproducible application packaging :-) |
For anyone wondering how to get this to work: flatpak --user override com.visualstudio.code \
--env=PATH=/app/bin:/usr/bin:/home/$USER/.cargo/bin |
The extension now downloads it's own rust-analyzer executable into the extension storage. I am using VSCode inside Flatpak and haven't had any trouble in a long time. |
Essentially the same issue occurs with VSCodium in a flatpak:
Solution is as above:
|
Could this be reopened? I had to use the |
@willswats What do you want rust-analyzer to do? Using |
@bjorn3 I don't know enough about rust-analyzer or flatpak to come up with a solution, but I wouldn't regard this as solved if the user has to search online for a fix. |
You should report the issue to the maintainer of the flathub package. |
@mmstick I ran [ERROR rust_analyzer::main_loop] FetchWorkspaceError:
rust-analyzer failed to load workspace: Failed to load the project at /home/ne/code/rust-actix-web/complete-application/Cargo.toml: Failed to query rust toolchain version at /home/me/code/rust-actix-web/complete-application, is your toolchain setup correctly?: cd "/home/me/code/rust-actix-web/complete-application" && "cargo" "--version" failed: No such file or directory (os error 2) |
Yeah I think VSCode under flatpak is just broken. They should remove it rather messing people around. Rather install it from the site proper - curl -L -o vscode.deb "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64" &&
sudo dpkg -i vscode.deb &&
rm vscode.deb; |
Problem
Linux distributions are collectively moving towards Flatpak as a distribution model for third party applications. However, the VS Code extension is currently unsupported within the VS Code Flatpak, due to the way that it tries to spawn
ra_lsp_server
by looking up its path within system paths — paths that won't exist inside of a Flatpak container.Solution
The extension could check for the existence of
/usr/bin/flatpak-spawn
to determine if being run within a Flatpak container. If within a Flatpak container,ra_lsp_server
can be invoked withflatpak-spawn --host ra_lsp_server
.The text was updated successfully, but these errors were encountered: