提交 a63d88ec 编写于 作者: M Matt Bierner

Make sure we normalize paths before sending them to tsserver

Fixes #84826
上级 ab05d797
...@@ -575,11 +575,15 @@ export default class TypeScriptServiceClient extends Disposable implements IType ...@@ -575,11 +575,15 @@ export default class TypeScriptServiceClient extends Disposable implements IType
return undefined; return undefined;
} }
const result = resource.fsPath; let result = resource.fsPath;
if (!result) { if (!result) {
return undefined; return undefined;
} }
if (resource.scheme === fileSchemes.file) {
result = path.normalize(result);
}
// Both \ and / must be escaped in regular expressions // Both \ and / must be escaped in regular expressions
return result.replace(new RegExp('\\' + this.pathSeparator, 'g'), '/'); return result.replace(new RegExp('\\' + this.pathSeparator, 'g'), '/');
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册