redhat-developer / redhat-developer/vscode-java

Code running in WSL:Ubuntu will not load the codestyle.xml located in the Windows filesystem

Open
#1,783 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I found that vscode cannot load an eclipse profile if vscode is using WSL as the terminal and the codestyle file is in the Windows filesystem. This I found is true regardless of the url syntax for local files, i.e., D:\path\to\file or /d/path/to/file. I had to copy the file into my WSL filesystem and reference is relative to the WSL root, i.e., /home/path/to/file.

Environment
  • Operating System: Windows_NT x64 10.0.19042 + WSLv2 + Ubuntu 20.10
  • JDK version: OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.10)
  • Visual Studio Code version: 1.52.1, Electron 9.3.5
  • Java extension version:
Steps To Reproduce
  1. configure Java › Format › Settings: Url to be drive_letter:\path\to\eclipse_codestyle.xml
  2. confirm the settings aren't used when formatting file
  3. configure Java › Format › Settings: Url to be file:///wsl_drive_mnt/path/to/eclipse_codestyle.xml
  4. confirm the settings aren't used when formatting file
  5. configure Java › Format › Settings: Url to be file:///path/to/eclipse_codestyle.xml
  6. confirm file is used when formatting file

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

Start by tracing how the Java › Format › Settings: Url value is resolved when VS Code uses WSL, reproducing the issue with the Windows and WSL path forms listed in the steps. Done means an Eclipse codestyle.xml on the Windows filesystem is loaded and applied during formatting under WSL.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, ubuntu, vscode
Domain
operating-systems, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.