oracle / javavscode

Java platform support for Visual Studio Code for full featured Java development (edit-compile-debug & test cycle)
Apache License 2.0
231 stars 31 forks source link

Oracle Java SE Language Server fails to initialize correctly in a directory containing spaces as of v23.0.0 #300

Closed mwernerh closed 1 month ago

mwernerh commented 1 month ago

As of v23.0.0, the language server fails to initialize correctly if a file is opened in a directory containing spaces. Modifying the directory names to avoid the use of spaces results in a successful initialization. However, reverting to v22.1.2 shows that the previous version of the extension could initialize the language server without problems, even for a file located in a directory containing spaces.

The error generated for a file in a directory with spaces, as of v23.0.0, is as follows

Initiating server activation
Request to kill LSP server.
Cannot kill: current process is None
Launching Oracle Java SE Language Server with /mnt/c/Users/invin/Desktop/Everything/Utilities/open-jdk-23.0.1 and userdir /home/Uinvin/.vscode-server/data/User/workspaceStorage/498fc74986182e8db43e45809883926d/Oracle.oracle-java
LSP server launching: 181
LSP server user directory: /home/Uinvin/.vscode-server/data/User/workspaceStorage/498fc74986182e8db43e45809883926d/Oracle.oracle-java
There are parameters but nobody wants to proces them: [2024/Data, Structures]
Cannot find org.netbeans.modules.java.lsp.server in the log!
Please refer to troubleshooting section for more info: https://github.com/oracle/javavscode/blob/main/README.md#troubleshooting
Request to kill LSP server.
Cannot kill: Requested kill on 181, current process is None
Oracle Java SE Language Server not enabled

Note that "2024" and "Data Structures" are part of the folder names that contain spaces.

sid-srini commented 1 month ago

Thank you @mwernerh for bringing this regression bug to our notice. This is possibly related to the changes done in #251. We will try to get this fixed in the next upcoming release. I am sorry for the inconvenience this has caused you.

sid-srini commented 1 month ago

@mwernerh - Would you please share some details about the environment in which you are running VSCode and the extension?

Thank you.

sid-srini commented 1 month ago

@mwernerh As a temporary workaround, until the fix is released, you may use one of the following options:

  1. Enable the Advanced setting "Disable: Project Search Limit" Screenshot 2024-10-23 at 11 30 13 AM
  2. Or, like you mentioned, modify the project root directory name to remove spaces (and, double-quotes, if any).