Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

We should use join to concatenate paths #986

Merged
merged 1 commit into from
Jan 16, 2024
Merged

Conversation

vinistock
Copy link
Member

Motivation

If someone defined a workspace folder with a trailing slash, we mistakenly concatenating yet another slash after it in our client document selector pattern. This made the LSP start normally, but not receive any requests from VS Code, because no files in the workspace matched the path.

For example

# If the workspace folder path was
my_folder/

# Then we would use the pattern
my_folder//**/*

# Which does not match anything

Implementation

The solution is to rely on path.join, which always does the right thing and takes operating systems into consideration.

@vinistock vinistock added the bugfix This PR will fix an existing bug label Jan 16, 2024
@vinistock vinistock self-assigned this Jan 16, 2024
@vinistock vinistock requested a review from a team as a code owner January 16, 2024 16:38
@vinistock vinistock merged commit 9e96991 into main Jan 16, 2024
10 checks passed
@vinistock vinistock deleted the vs/fix_pattern_joining branch January 16, 2024 16:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bugfix This PR will fix an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants