redhat-developer / redhat-developer/vscode-java

Set environment variables for language server

Open
#2,348 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement preferences
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

As far as I understand this extension launches the process for the language server backend. It could be beneficial to be able to configure the environment variables used when executing the language server, in a similar fashion as in the 'Maven for Java' extension here: https://github.com/Microsoft/vscode-maven/#additional-configurations

My use case is the following:

I am using VS Code with Remote SSH, and trying to work on a Maven based Java project. Currently I am configuring the java.configuration.maven.userSettings setting to point to a project specific Maven settings file. This settings file makes use of an environment variable, which is not set by default on the remote machine shell as it changes from project to project. Therefore the extension imports and tries to build this Maven project, the user settings is used correctly, but the environment variable is not defined.

(Sorry if this suggestion is incorrect, as I am a new user of the extension)

Environment
  • Operating System: Linux
  • JDK version: 11
  • Visual Studio Code version: 1.65.0
  • Java extension version: 1.4.0
Steps To Reproduce
  1. Use VS Code Remote SSH on a machine that does NOT have the environment variable MY_REPO defined by default.
  2. Create Maven settings file with: <localRepository>${MY_REPO}/repo</localRepository>
  3. Set java.configuration.maven.userSettings to point to the created Maven settings file
  4. Create Maven Java project and let the extension import and build the project

A local folder called "${MY_REPO}" will be created, as the environment variable is not defined.

Current Result

Environment variable used in Maven settings file cannot be configured.

Expected Result

Environment variable used in Maven settings file can be configured.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source files or tests are named. Start by tracing how the extension launches the language-server backend and how java.configuration.maven.userSettings reaches Maven; reproduce with Remote SSH and MY_REPO, with the work done when the configured environment variable is available during project import and build.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.