Make sure we normalize paths before sending them to tsserver

Fixes #84826
This commit is contained in:
Matt Bierner 2019-11-25 20:58:47 -08:00
parent ab05d79769
commit a63d88ec55

View file

@ -575,11 +575,15 @@ export default class TypeScriptServiceClient extends Disposable implements IType
return undefined;
}
const result = resource.fsPath;
let result = resource.fsPath;
if (!result) {
return undefined;
}
if (resource.scheme === fileSchemes.file) {
result = path.normalize(result);
}
// Both \ and / must be escaped in regular expressions
return result.replace(new RegExp('\\' + this.pathSeparator, 'g'), '/');
}