rust-analyzer: vscode plugin fails when behind corporate proxy

cargo metadata --manifest-path /project/path/Cargo.toml returns a bunch of 'spurious network error’s, because I’m on a corporate network and need to go through a proxy. I have proxy settings configured in vscode, already.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 23 (12 by maintainers)

Most upvoted comments

There should be logs in Help > Toggle Developer Tools > Console. However, you cannot install the extension to the directory specified like that. The extension stores the binary version in its internal persistent state.

As a workaround you should explicitly set rust-analyzer.serverPath.

I saw the code of vscode-cpptools where they deal with http proxies but didn’t wonder what was that and why this compexity is required…

See https://doc.rust-lang.org/cargo/reference/config.html#httpproxy. Does cargo work for you when started from the command line?

You might want to run chmod +x ~/.config/Code/User/globalStorage/matklad.rust-analyzer/rust-analyzer.

See https://code.visualstudio.com/docs/setup/network#_proxy-server-support for proxy configuration in Code.

EDIT: If you’ve already configured http.proxy, I’m not sure why it’s not working. The setting should also apply to extensions. CC @Veetaha.