提交 36e7f187 编写于 作者: K Khaja Nizamuddin 提交者: Alex Ross

Normalize tsconfig path (#73001)

Fixes #68812
上级 728c6a68
......@@ -96,6 +96,7 @@ class TscTaskProvider implements vscode.TaskProvider {
const uri = editor.document.uri;
return [{
path: uri.fsPath,
posixPath: uri.path,
workspaceFolder: vscode.workspace.getWorkspaceFolder(uri)
}];
}
......@@ -121,6 +122,7 @@ class TscTaskProvider implements vscode.TaskProvider {
const folder = vscode.workspace.getWorkspaceFolder(uri);
return [{
path: normalizedConfigPath,
posixPath: uri.path,
workspaceFolder: folder
}];
}
......@@ -232,9 +234,9 @@ class TscTaskProvider implements vscode.TaskProvider {
private getLabelForTasks(project: TSConfig): string {
if (project.workspaceFolder) {
return path.relative(project.workspaceFolder.uri.fsPath, project.path);
return path.posix.relative(project.workspaceFolder.uri.path, project.posixPath);
}
return project.path;
return project.posixPath;
}
private onConfigurationChanged(): void {
......
......@@ -6,6 +6,7 @@ import * as vscode from 'vscode';
export interface TSConfig {
readonly path: string;
readonly posixPath: string;
readonly workspaceFolder?: vscode.WorkspaceFolder;
}
......@@ -20,6 +21,7 @@ export default class TsConfigProvider {
if (root) {
configs.set(config.fsPath, {
path: config.fsPath,
posixPath: config.path,
workspaceFolder: root
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册