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

failed to discover workspace when running as a live share session guest #8844

Closed
classabbyamp opened this issue May 15, 2021 · 8 comments
Closed
Labels
A-documentation docs for rust-analyzer usage/inner working A-vscode vscode plugin issues C-bug Category: bug

Comments

@classabbyamp
Copy link

classabbyamp commented May 15, 2021

When running as a guest in a live share session, rust-analyzer shows an error popup that it "failed to discover workspace". In the debug output, there is this message:

[ERROR rust_analyzer] failed to find any projects in [AbsPathBuf("/")]

The full trace log is here: rust-analyzer_trace.log

Versions:

  • Rust: 1.52.0
  • rust-analyzer: 0.2.591
  • Live share: 1.0.4272
  • vscode: 1.56.2 and later
  • OS: Arch Linux and Void Linux (but the live share host is Windows 10)

The same thing happened (with a different path in the error) going the other way, with the windows guest on linux host session.

@0x5c
Copy link

0x5c commented May 15, 2021

From the windows side, the path is an arbitrary drive letter.

@bjorn3
Copy link
Member

bjorn3 commented May 15, 2021

    "workspaceFolders": [
        {
            "uri": "vsls:/",
            "name": "least"
        }
    ]

This isn't going to work. Rust-analyzer needs to be able to read files outside of the control of the editor. This is necessary to for example run cargo metadata as it doesn't have vfs support and thus can't read any files straight from the editor through the language server protocol. Is there an option to run the language server on the live share host and pass the real location of the workspace?

@0x5c
Copy link

0x5c commented May 15, 2021

That's weird, because the error happens on the visitor side, and the windows visitor gets a drive letter in the path even when the host is running linux, and vice-versa
The drive letter is also not the one where rust/rust-analyzer/etc is installed, but the one where VSCode is installed.

@classabbyamp
Copy link
Author

classabbyamp commented May 15, 2021

Is there an option to run the language server on the live share host and pass the real location of the workspace?

rust-analyzer is running on both the host and visitor already. Are you saying there is/should be a way to pass the host's r-a to the visitor?

@bjorn3
Copy link
Member

bjorn3 commented May 16, 2021

Either the host's r-a needs to be passed through to the visitor or live share needs to report the actual location of the local mount of the project instead of vsls:/ as location for the workspace.

@jonas-schievink jonas-schievink added A-vscode vscode plugin issues C-bug Category: bug labels Aug 17, 2022
@jonas-schievink
Copy link
Contributor

Live Share only works with rust-analyzer when using Microsoft's official VS Code builds, it does not work with OSS builds or VS Codium. rust-analyzer does not have to be installed or enabled locally for this to work. If rust-analyzer is enabled locally, then you get the error popup (which can be ignored).

We should add this to the manual, and ideally figure out a way to not activate the local extension when running in a Live Share session.

@jonas-schievink jonas-schievink added the A-documentation docs for rust-analyzer usage/inner working label Aug 18, 2022
@classabbyamp
Copy link
Author

@jonas-schievink

Live Share only works with rust-analyzer when using Microsoft's official VS Code builds

yes, this bug would not be possible if I wasn't using the official build

this might help with solving this issue

bors added a commit that referenced this issue Aug 26, 2022
…-schievink

fix: Avoid error popup when using in Live Share

cc #8844

Not sure if there's a better way to do this, feedback appreciated!
@jonas-schievink
Copy link
Contributor

With #13095 and #13097, the Live Share behavior should now be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documentation docs for rust-analyzer usage/inner working A-vscode vscode plugin issues C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

4 participants