Normalize tsconfig path (#73001)

Fixes #68812
This commit is contained in:
Khaja Nizamuddin
2019-05-21 16:31:54 +05:30
committed by Alex Ross
parent 728c6a68ba
commit 36e7f1871a
2 changed files with 6 additions and 2 deletions

View File

@@ -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 {

View File

@@ -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
});
}