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

Account for lowercase drive letter on Windows #885

Merged
merged 1 commit into from
Aug 14, 2023
Merged

Account for lowercase drive letter on Windows #885

merged 1 commit into from
Aug 14, 2023

Conversation

gifvex
Copy link
Contributor

@gifvex gifvex commented Aug 13, 2023

Motivation

The recent release of Shopify/vscode-ruby-lsp@53fb04a made the extension work on Windows. On Windows, VS Code can spawn the terminal used by extensions with a lowecase drive letter, which causes the following error and prevents the extension from starting:
URI::InvalidComponentError: bad component(expected absolute path component): c:/some/windows/path/to/file.rb

Implementation

The drive pattern introduced in #850 was switched to case-insensitive.

Automated Tests

The tests also introduced in #850 were expanded to cover lowercase drive letters.

@gifvex gifvex requested a review from a team as a code owner August 13, 2023 19:48
@gifvex gifvex requested review from andyw8 and bitwise-aiden August 13, 2023 19:48
@gifvex
Copy link
Contributor Author

gifvex commented Aug 13, 2023

I have signed the CLA!

@gifvex
Copy link
Contributor Author

gifvex commented Aug 14, 2023

Update pushed; moved the CGI.unescape in to_standardized_path to happen before the regex looks for a colon.

path = @uri.to_standardized_path
return unless path.nil? || path.start_with?(T.must(WORKSPACE_URI.to_standardized_path))

The check here to run rubocop failed because the language server protocol can send escaped colons (example @ learn.microsoft.com) and the added / wasn't being removed.

Copy link
Member

@vinistock vinistock 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 very much for the contribution!

@vinistock vinistock added the bugfix This PR will fix an existing bug label Aug 14, 2023
@vinistock vinistock merged commit b23dcbe into Shopify:main Aug 14, 2023
@shopify-shipit shopify-shipit bot temporarily deployed to production August 17, 2023 15:02 Inactive
vinistock added a commit that referenced this pull request Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants