It is not possible to use SonarLint if the absolute path of VSCode extension dir contains a foreign character.
é is in this case, the foreign character.
Versions used:
SonarLint VSCode extension v. 2.0.0
Java v. jre1.8.0_291
Errors observed
SonarLint does not start properly
Steps to reproduce
Can be reproduced using following command, as it seems that the extension uses the same way to execute the JAR: java -jar c:\Users\JacobHonoré\.vscode\extensions\sonarsource.sonarlint-vscode-2.0.0\server\sonarlint-ls.jar
The above returns the following error: Error: An unexpected error occurred while trying to open file c:\Users\JacobHonoré\.vscode\extensions\sonarsource.sonarlint-vscode-2.0.0\server\sonarlint-ls.jar
Potential workaround
I fixed the issue by running VSCode with --extensions-dir="C:\vscode\extensions" which ensures my extensions dir absolute path does not contain any foreign character (é).
Another workaround could be if the extension can execute the jar file directly from the extensions directory, and not by using the full absolute path. Executing java -jar .\server\sonarlint-ls.jar while in the C:\Users\JacobHonoré\.vscode\extensions\sonarsource.sonarlint-vscode-2.0.0 seems to work without any issues.
Hello Jacob.
Welcome to the community and thank you for your report and very useful details.
Sorry for the late reply. I’ve created ticket for this error and you can keep track on progress here. https://jira.sonarsource.com/browse/SLVSCODE-199
I was not able to reproduce your issue. Are you sure the accent is the problem? Could it be that the JAR file is corrupted in c:\Users\JacobHonoré\.vscode\extensions\sonarsource.sonarlint-vscode-2.0.0\server\sonarlint-ls.jar and that switching to a different location for SonarLint extensions forced VSCode to download extensions again?
Do you have a full stack trace of the error?
Thank you for looking into this!
As you were not able to reproduce the issue, I tried a two more things:
Installed a fresh Extension, using c:\vscode\tést as extension dir
Installing JDK-8.0.222.10, as I noticed that this is the one you are using.
Unfortunately nothing of the above helped on the issue. I am getting the following error.
Let me know if I can do something to get a more verbose error message.
Thank you so much @Julien_HENRY - it helped to change the system locale parameter, but I also had to disable the “Beta: Use Unicode UTF-8 for worldwide language support” feature.