File tree 1 file changed +3
-5
lines changed
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -108,9 +108,8 @@ export class ClangdContext implements vscode.Disposable {
108
108
function fix_windows_drive_letter_casing ( uri : vscode . Uri ) : string | undefined {
109
109
// We can't just use process.platform === 'win32' because of remote development
110
110
111
- // https://stackoverflow.com/a/64822303/4479969
112
111
// detect windows paths
113
- const isWindowsPathRegex = / ^ (?< drive > [ a - z ] : ) ? (?< path > (? :[ \\ ] ? (?: [ \w ! # ( ) - ] + | [ . ] { 1 , 2 } ) + ) * [ \\ ] ) ? (?< filename > (?: [ . ] ? [ \w ! # ( ) - ] + ) + ) ? [ . ] ? $ / i;
112
+ const isWindowsPathRegex = / ^ (?< drive_letter > [ a - z A - Z ] ) : [ \\ \/ ] (?< remainingPath > . * ) / i;
114
113
115
114
// Fix lower case drive letters on Windows
116
115
const fsPath = uri . fsPath
@@ -124,16 +123,15 @@ export class ClangdContext implements vscode.Disposable {
124
123
125
124
// change the drive letter to uppercase
126
125
const drive = windowsPathMatch . groups ?. drive ?. toUpperCase ( ) ?? '' ;
127
- const path = windowsPathMatch . groups ?. path ?? '' ;
128
- const filename = windowsPathMatch . groups ?. filename ?? '' ;
126
+ const remainingPath = windowsPathMatch . groups ?. remainingPath ?? '' ;
129
127
130
128
if ( ! drive ) {
131
129
// no drive letter so there is nothing to fix
132
130
return undefined ;
133
131
}
134
132
135
133
// Reconstruct the path
136
- const fixed_uri = `file:///${ drive } ${ path } ${ filename } ` ;
134
+ const fixed_uri = `file:///${ drive } ${ remainingPath } ` ;
137
135
return fixed_uri ;
138
136
}
139
137
You can’t perform that action at this time.
0 commit comments