Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rdcoe opened this issue Jan 30, 2021 · 7 comments

Comments

@rdcoe
Copy link

rdcoe commented Jan 30, 2021

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
@snjeza
Copy link
Contributor

snjeza commented Jan 31, 2021

@rdcoe you can try
/mnt/drive_letter/path/to/eclipse_codestyle.xml

@rdcoe
Copy link
Author

rdcoe commented Jan 31, 2021 via email

@snjeza
Copy link
Contributor

snjeza commented Jan 31, 2021

Could you try

ls /mnt/drive_letter/path/to/eclipse_codestyle.xml
or
ls /drive_letter/path/to/eclipse_codestyle.xml
drive_letter is without : as /mnt/c/path/to/eclipse_codestyle.xml or /c/path/to/eclipse_codestyle.xml
See microsoft/WSL#1918

@rdcoe
Copy link
Author

rdcoe commented Feb 1, 2021 via email

@rdcoe
Copy link
Author

rdcoe commented Feb 1, 2021

btw, I see you linked it to the issue on changing the mount point. I did that quite a long time ago, using the wsl.conf method that's described in the issue.

cat /etc/wsl.conf
[automount]
root = /
options = "metadata"

@snjeza
Copy link
Contributor

snjeza commented Feb 1, 2021

Is this what you're looking for?

yes, it is. You should use:

"java.format.settings.url": "/d/OneDrive/Documents/Development/eclipse_codestyle.xml",

could you attach your server log ?

@rdcoe
Copy link
Author

rdcoe commented Feb 1, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants