Comments (10)
@olafurpg Thanks for your fast response, this worked π π
That said, I think this could be improved. I've set my HTTP proxy in two other places already:
JAVA_OPTS
in/etc/environment
(sbt
picks this one up)http.proxy
in VSCode'ssettings.json
(code extensions pick this one up)
I'd argue that this extension should pick up at least one of these. How about changing fetchAndLaunchMetals
to either
- explicitly set
-Dhttps.proxyHost
, etc. according to thehttp.proxy
setting, or - splice
JAVA_OPTS
into the coursier invocation?
Picking up JAVA_OPTS
for this invocation seems like a good idea beyond this ticket, since this variable is often used to set general Java flags.
What do you think? I'd do a pull request for this if you like.
from metals-vscode.
Thanks for reporting! Can you try updating -Dhttps.proxyHost=β¦ -Dhttps.proxyPort=β¦
in the "Server Properties" setting for Metals in VS Code? Alternatively, those properties are picked up automatically from .jvmopts
if they are defined there.
from metals-vscode.
I didn't know about http.proxy
in VSCode settings, and I think respecting it would be intuitive behavior. Wdyt @olafurpg?
from metals-vscode.
@swiesner-dlr I agree this can be improved, I like your suggestions π
from metals-vscode.
@gabro I just read the VSCode documentation again and it looks like http.proxy
is considered βlegacyβ, though it's not exactly clear what the replacement is supposed to be.
Perhaps JAVA_OPTS
is the better way forward?
@olafurpg Thanks. Would you like a pull request? If so, which option would you like to see implemented?
from metals-vscode.
In that case I like respecting JAVA_OPTS
. We should include the options both when launching metals and also when running coursier fetch
. A good place to fix this would be somewhere around here
metals-vscode/src/extension.ts
Line 84 in c2e3196
from metals-vscode.
@swiesner-dlr thanks for looking into it. I think it would also be interesting to try setting http.proxySupport
to override
. Would you mind trying that? https://code.visualstudio.com/updates/v1_30#_network-proxy-support-for-extensions
from metals-vscode.
@gabro I saw that option, and I searched VSCode's code for what it does, and from what I saw it only affects HTTP calls from Javascript directly, by injecting proxy settings into the underlying network handler of Electron. I doesn't look like it automatically propagates to subprocesses or offers a dedicated way to get hold of current proxy settings.
from metals-vscode.
BTW, note that environment variables don't always propagate when starting VS Code as a GUI applications. It's best to start it with the code
binary from the terminal to expose JAVA_OPTS
.
from metals-vscode.
Thanks for the reminder! I know that GUI and env variables are a mess on macOS, but this issue affects me only on Linux (I don't have a mac at work), so I'm fine π
from metals-vscode.
Related Issues (20)
- Getting `Failed to connect with build server....` while using devcontainer HOT 4
- vscode metals not updating as download fails with ssl errors HOT 7
- Can't run java 21 via code lens / debug HOT 1
- "Internal error" launch config error message HOT 3
- [VSCode] Metals is generating files on click the extension view, even if I'm not in a Scala project HOT 8
- Fails to download on Windows with output "Error creating cache directory...Caused by: java.nio.file.AccessDeniedException: C:\Program Files\Microsoft VS Code\null" HOT 5
- Use coursier for downloading Java
- metals 1.27 not starting on vscode 1.85.2 on RHEL Linux 7.9 air gapped (https://repo1.maven.org not accessible) HOT 8
- Bug πππππ cannot debug simple scala program and its not compiled and not genrate .scala-build HOT 7
- Java home not recognised HOT 10
- Sbt bloopInstall HOT 3
- No metals symbol on sidebar, can't start metals. HOT 8
- When no workspace and metals cannot start show error message in a more visible place HOT 2
- Fresh worksheet does not work: `java.lang.NoClassDefFoundError: Could not initialize class dotty.tools.dotc.NoCompilationUnit$` HOT 1
- An error report when install metals "Error: Failed to establish a socket connection to proxies" HOT 1
- Metals does not start anymore on Windows in VS Code since the VS Code extension v1.30.0 HOT 47
- Metals 1.30.0 doesn't start anymore on NixOS HOT 2
- Client Metals: connection to server is erroring. Shutting down server. HOT 16
- Missing HTTP proxy settings for Coursier when fetching Metals HOT 9
- Can't start Metals server with JDK with cyrillic characters in the path HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metals-vscode.