Coder Social home page Coder Social logo

Comments (10)

 avatar commented on July 26, 2024 1

@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's settings.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 the http.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.

olafurpg avatar olafurpg commented on July 26, 2024

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.

gabro avatar gabro commented on July 26, 2024

I didn't know about http.proxy in VSCode settings, and I think respecting it would be intuitive behavior. Wdyt @olafurpg?

from metals-vscode.

olafurpg avatar olafurpg commented on July 26, 2024

@swiesner-dlr I agree this can be improved, I like your suggestions πŸ‘

from metals-vscode.

 avatar commented on July 26, 2024

@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.

olafurpg avatar olafurpg commented on July 26, 2024

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

const serverProperties: string[] = workspace

from metals-vscode.

gabro avatar gabro commented on July 26, 2024

@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.

 avatar commented on July 26, 2024

@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.

olafurpg avatar olafurpg commented on July 26, 2024

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.

 avatar commented on July 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.