Skip to content

Conversation

@jkringel
Copy link
Contributor

Summary

Fixes a regression introduced in #151 where path quoting broke the Java extension on macOS and Linux.

Closes #155

Problem

PR #151 added double-quote wrapping to paths to fix spaces-in-path issues on Windows. However, this broke macOS and Linux because:

  • On Windows, Zed's proxy uses shell mode, where quotes are interpreted and stripped
  • On macOS/Linux, the proxy uses spawn() with shell: false, which treats quotes as literal filename characters

This caused "No such file or directory (os error 2)" errors on macOS/Linux because the system was looking for files like "/path/to/java" (with literal quotes in the filename).

Solution

  • Only apply path quoting on Windows via runtime current_platform() check
  • Extract format_path_for_os() helper function for testability
  • Add unit tests covering Windows, Mac, and Linux behavior

The path_to_quoted_string() function now only quotes paths on Windows,
where the proxy uses shell mode. On Unix systems, the proxy uses
spawn() with shell:false, which treats quotes as literal filename
characters, causing "No such file or directory" errors.

- Use runtime platform check to conditionally quote paths
- Extract format_path_for_os() helper for testability
- Add unit tests for Windows, Mac, and Linux behavior
@cla-bot
Copy link

cla-bot bot commented Dec 21, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @jkringel on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

Copy link
Collaborator

@playdohface playdohface left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@playdohface
Copy link
Collaborator

@jkringel thanks for this, we should not have missed this in the first place but luckily our community is fast to fix things. Please sign the Zed license agreement to make the CLA bot happy and we are good to go I think :)

@jkringel
Copy link
Contributor Author

@cla-bot check

@cla-bot
Copy link

cla-bot bot commented Dec 21, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @jkringel on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@cla-bot
Copy link

cla-bot bot commented Dec 21, 2025

The cla-bot has been summoned, and re-checked this pull request!

@jkringel
Copy link
Contributor Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed label Dec 21, 2025
@cla-bot
Copy link

cla-bot bot commented Dec 21, 2025

The cla-bot has been summoned, and re-checked this pull request!

@playdohface playdohface merged commit a89b5d8 into zed-extensions:main Dec 21, 2025
5 checks passed
@jkringel jkringel deleted the fix-quoted-paths-unix branch December 21, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Language server jdtls: from extension "Java" version 6.8.2: No such file or directory (os error 2)

2 participants