Skip to content

Fix URI parsing/formatting #969

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

Merged
merged 2 commits into from
May 28, 2025
Merged

Fix URI parsing/formatting #969

merged 2 commits into from
May 28, 2025

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented May 28, 2025

Fixes #932

These tests are from vscode-uri.

I suspect this isn't perfect, but I think this is sufficient as a stop-gap to fix the major problems without porting vscode-uri itself.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes URI parsing/formatting issues, addressing major problems without fully porting vscode-uri.

  • Renames the volume character detection function from isVolumeCharacter to IsVolumeCharacter for export.
  • Adds helper functions (fixWindowsURIPath, splitVolumePath) to support Windows URI path parsing.
  • Updates URI conversion functions and introduces comprehensive test coverage in converters_test.go.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
internal/tspath/path.go Renamed helper function for volume detection and updated call-sites accordingly.
internal/ls/converters_test.go Added tests for DocumentURIToFileName and FileNameToDocumentURI covering various cases.
internal/ls/converters.go Revised URI conversion logic with Windows path handling and enhanced escaping.

@jakebailey jakebailey added this pull request to the merge queue May 28, 2025
Merged via the queue into main with commit 8ca1bda May 28, 2025
23 checks passed
@jakebailey jakebailey deleted the jabaile/fix-uri branch May 29, 2025 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Paths with parenthesis cause the vscode extension to not understand import parths
2 participants